Skip to content

Conversation

@ning-y
Copy link
Member

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

Duplicate of #29, forgot to set that one to merge to master.

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.
remo5000 and others added 26 commits May 20, 2018 21:00
I realised that source academy does not clear the context, and that
clearing only the output is in line with most command-line applications
and REPLs.
This reverts commit 4bd3c44.
Was received from merging master into the branch
Would cause tiny bit of empty space on the right of the page, slightly outside
the viewport.
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.
RTTC errors (type errors found at runtime) will now interrupt execution of the
program and return an error immediately.

Checks for unary expression arguments have been implemented.
Function type checks not yet implemented
@ning-y ning-y requested a review from remo5000 May 26, 2018 08:52
@ning-y ning-y merged commit e334eff into master May 26, 2018
@ning-y ning-y deleted the if-rttc branch May 26, 2018 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants