Skip to content

Commit

Permalink
Merge pull request #36 from ldevernay/variable_name
Browse files Browse the repository at this point in the history
Issue #26: Common variable keyword is part of name
  • Loading branch information
ldevernay authored Oct 24, 2018
2 parents 6e80ab4 + 250da13 commit b107428
Show file tree
Hide file tree
Showing 5 changed files with 309 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
examples/*.js
rockstar-parser.js
package-lock.json
2 changes: 1 addition & 1 deletion examples/listen.rock
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Listen to my voice
Build your voice up
Build my voice up
Scream my voice
202 changes: 202 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/rockstar-parser.peg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Comment = '(' [^)]* ')'
Variable =
(n:(CommonVariable / ProperVariable) {return {t: 'Variable', n}})
/ Pronoun {return {t: 'Pronoun'}}
CommonVariable = ('the'i/'my'i/'your'i) _ v:$([a-z]+) {return v}
CommonVariable = p:('the'i/'my'i/'your'i) _ v:$([a-z]+) {return p+v}
ProperWord = $([A-Z][A-Za-z]+)
ProperVariable = $(ProperWord _ ProperVariable) / $ProperWord
Pronoun = (
Expand Down
Loading

0 comments on commit b107428

Please sign in to comment.