Skip to content

Commit

Permalink
Add support for let <variable> be <expression>
Browse files Browse the repository at this point in the history
Fixes #186
  • Loading branch information
dylanbeattie committed Mar 24, 2019
1 parent 7257682 commit 7a59c3a
Show file tree
Hide file tree
Showing 7 changed files with 300 additions and 151 deletions.
2 changes: 1 addition & 1 deletion satriani/package.json
Expand Up @@ -21,7 +21,7 @@
"deploy": "node_modules/gh-pages/bin/gh-pages.js -u 'CircleCI <circleci@codewithrockstar.com>' -r git@github.com:RockstarLang/codewithrockstar.com.git --add --src docs/js/satriani.js -m 'Updated js/satriani.js from main repo' -b master -d deploy",
"serve": "python -m SimpleHTTPServer 8000",
"pegjs": "node node_modules/pegjs/bin/pegjs -o satriani.parser.js rockstar.peg",
"test": "mocha test/*.js"
"test": "yarn pegjs && mocha test/*.js"
},
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions satriani/rockstar.peg
Expand Up @@ -256,6 +256,8 @@ assignment = v:variable ('\'s' / (_* ('=' / 'is 'i / 'was 'i / 'are 'i / 'were
{ return { assign: { variable: v, expression: e} }; }
/ 'put'i _+ e:expression _+ 'into'i _+ v:variable
{ return { assign: { variable: v, expression: e} }; }
/ 'let'i _+ v:variable _+ 'be'i _+ e:expression
{ return { assign: { variable: v, expression: e} }; }

poetic_string = s:$[^\n]*
{ return { string: s} }
Expand Down

0 comments on commit 7a59c3a

Please sign in to comment.