Skip to content

Commit

Permalink
Common variable keyword is part of name #26
Browse files Browse the repository at this point in the history
  • Loading branch information
ldevernay committed Oct 24, 2018
1 parent 62f263b commit 29a1476
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 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
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

0 comments on commit 29a1476

Please sign in to comment.