Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Math obj, symbols NaN and Infinity #22

Merged
merged 147 commits into from
May 26, 2018
Merged

Add Math obj, symbols NaN and Infinity #22

merged 147 commits into from
May 26, 2018

Conversation

ning-y
Copy link
Member

@ning-y ning-y commented May 22, 2018

Issues fixed

ning-y and others added 30 commits May 14, 2018 10:48
Changes:
- Changed `Playground` component to a statefull one (extends `React.Component)
- add property `playgroundCode` to IApplicationState (bad practice,
change to a slice of the state instead)
- add interface `IPlaygroundProps` to denote the properties passed to
Playground
Once again, this is a WIP. Text typed into the playground editor will
stay in the playground (or rather, appear again) after leaving and
coming back.

Changes:
- added of action, actionCreator (updatePlaygroundCode)
- added a reducer under application's `reducer` function

Possible problems:
- Location of reducer
- Location of playgroundCode stored (as in previous commit)
Made a compromise by including an IPlaygroundState as part of IApplicationProps
This is a copy over of the current state of `./frontend/src/toolchain` at
source-academy/source-academy2 67d9184. It includes only source chapter 1, a new
specification (see [PR 6 at the
source-academy/source-academy2](source-academy/source-academy2#6)
repository).
The react types were added as a result of the `yarn add` command.
ning-y added 11 commits May 21, 2018 14:12
Okay, so slang's display needs access to the store in order to call dispatch, so
that the display can be output'd in realtime. In the previous commit, this was
achieved by importing the instantiated store from src/index.tsx into
src/slang/stdlib/misc.ts.

This works when the full server is running, but fails with the tests, because
mockContext calls createContext, which imports stdlib/misc, which tries to
import store. But because it's just a test, and store doesn't exist, the test
fails.
Next, change display so that if playground.output array is empty, initialise.
This is because the Output SFC tries to access an undefined output.consoleLogs.

output.consoleLogs is undefined after an Eval button click, because
EVAL_INTERPRETER_(SUCCESS|ERRORS) will try to access the last element of
playground.outputs, but the last element after playground.outputs is always a
CodeOutput for Eval button presses; and CodeOutput doesn't have a consoleLogs
property, so EVAL_INTERPRETER_(SUCCESS|ERRORS) copies over undefined as the new
ResultOutput or ErrorOutput's consoleLog property.
Math: resolves #20,
Symbols: resolves #16
@ning-y ning-y added the blocked Something else needs pass review first label May 22, 2018
@ning-y ning-y added this to the Sprint 1 milestone May 22, 2018
@ning-y ning-y added Bug Something isn't working slang and removed blocked Something else needs pass review first labels May 22, 2018
@ning-y ning-y requested a review from evansb May 24, 2018 04:11
@ning-y ning-y mentioned this pull request May 25, 2018
@ning-y ning-y added the blocking Finishing this opens up other stuff label May 25, 2018
@ning-y ning-y changed the base branch from functioning-ide to master May 25, 2018 03:38
ning-y added 2 commits May 26, 2018 16:23
* Rename context.week -> context.chapter

* Add list library

TODO: Arrow functions do not work with map

* Make context chapter 2 by default for dev

* Fix arrow funcs not working with map/build_list...

* Revert default libraries back to chap 1

* Add sourceChapter property to playground state

Playground defaults to most recent source chapter.

* Add component for selecting source chapters

Not yet wired.

* Add action for chapter select

Not yet wired up.

* Add chapter select

* Add section sign, notification on chapter change

* Add list.equal
@ning-y ning-y merged commit e9961bc into master May 26, 2018
@ning-y ning-y deleted the slang-add-builtins branch May 26, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking Finishing this opens up other stuff Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants