Open
Conversation
tigershen23
commented
Jan 19, 2017
| }), | ||
| exp: (exp, left, right) => ({ | ||
| type: "EXP", | ||
| value: exp, |
Contributor
Author
There was a problem hiding this comment.
@richardartoul Can the value ever be something besides an operator with the way you wrote https://github.com/Bradfield/languages-2017-01/pull/2/files#diff-fe30eed34176a05cc930283036bce555R39? If we don't have a valid value that isn't an operator, what do you think about calling this key op to avoid ambiguity?
| : LET id ASSIGN exp -> af.declareAssign($2, $4) | ||
| ; | ||
|
|
||
| function_call |
| | DIVIDE -> af.operator("DIVIDE") | ||
| ; | ||
|
|
||
|
|
Contributor
Author
There was a problem hiding this comment.
nit: xtra whitespace
| | id -> af.exp($1, null, null) | ||
| | function_call -> af.exp($1, null, null) | ||
| | exp operator exp -> af.exp($2, $1, $3) | ||
| | OPAREN exp CPAREN -> $2 |
|
Thanks for doing this, excited to work on this tomorrow! Also sorry about the crappy test runner. When I got home I noticed that we had introduced regressions even in our 3 hour session (making the function declarations accept arguments broke the functionality for functions with no arguments) so I threw something together really fast. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wanted to add on to Richie's work without pushing to his fork and Myles suggested just working off of this repo instead of forking anyways, so I figured I would make a hub PR for the rest of our lex/parse work.
Supercedes #1
Here's a version of our language spec augmented with some examples, hopefully it can be used to track how much functionality we are able to parse and what remains to be done.
Feel free to push to this branch directly (or branch off of it) and check off items you add. We can also merge stuff into master as we feel comfortable with it, up to y'all really.
func () => {}1234-24"hello world""hello \" yo\"world"if (condition) { } else if (condition) { } else { }[1, 2, "hey guys", 4]#{key1: val1, 2: #{subkey: subval}# }#let foo = "bar"while(true) {}+ - / *