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

Improve Newspeak compatibility #178

Merged
merged 14 commits into from
Jul 29, 2017
Merged

Improve Newspeak compatibility #178

merged 14 commits into from
Jul 29, 2017

Conversation

smarr
Copy link
Owner

@smarr smarr commented Jul 29, 2017

With these changes, the Newspeak source in the main repository can be parsed with only minor cheating, i.e., adaptations for silly parser incompatibilities.
There are still various things in the parser that could use fixing, but it is good enough for now.

  • Support two single quotes as escape sequence
  • Make sure minus can be parsed as part of operator sequence
  • Make sure - and ! can be part of symbols
  • Fix issues with cascades
    • Register cascade temps in scope
    • Fix cascades in local initializers
    • Don't do AST-level inlining while parsing slots/locals
    • Add tests for cascades in inlined scopes
  • Added parser support for literal characters
  • Support comments in more places
  • Add guards for inlining on things that are not supported
  • Fix syntax for tupleType to use dot as separator
  • Parse simSlot decls like normal ones and accept empty slot/local declarations
  • Refactor handling of nested classes and methods parsing to be able to accept method named class

smarr added 10 commits July 29, 2017 15:09
In Newspeak, inside a string '' is parsed to ', i.e. a single quote.

Signed-off-by: Stefan Marr <[email protected]>
Needed for instance for {#FooBar -> 45}

Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
- also use builder methods to create nodes, as we do everywhere else in the parser

Signed-off-by: Stefan Marr <[email protected]>
They are parsed to one element strings.

Signed-off-by: Stefan Marr <[email protected]>
Before locals have finished parsing, we haven’t set the variables yet on the scope. So, avoid adding the cascade temp.

Signed-off-by: Stefan Marr <[email protected]>
@smarr smarr added bug Fixes an issue, incorrect implementation enhancement Improves the implementation with something noteworthy labels Jul 29, 2017
@smarr smarr added this to the v0.5.0 milestone Jul 29, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 80.188% when pulling 2155ba6 on ns-compat into bd532ac on dev.

…arations

Proper support for simultaneous slot declarations still needs runtime changes.
Added warning to indicate the missing support.

Signed-off-by: Stefan Marr <[email protected]>
… accept method named class

Signed-off-by: Stefan Marr <[email protected]>
Repository owner deleted a comment Jul 29, 2017
Repository owner deleted a comment Jul 29, 2017
@smarr smarr merged commit 6071a53 into dev Jul 29, 2017
@smarr smarr deleted the ns-compat branch July 29, 2017 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes an issue, incorrect implementation enhancement Improves the implementation with something noteworthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants