Skip to content

Commit

Permalink
fix(AtomParser): add new production rule to support loops
Browse files Browse the repository at this point in the history
  • Loading branch information
aadhithya committed May 16, 2022
1 parent 7c951eb commit ab91aad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rajinipp/parser/atom_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class AtomParser:
"""parse all atomic components."""

def parse(self, pg):
@pg.production("forvar : NUMBER")
@pg.production("expression : NUMBER")
def number_expr(p):
logger.debug("Parser --> number")
Expand All @@ -22,6 +23,7 @@ def string_expr(p):
logger.debug("Parser --> string")
return String(p[0].value)

@pg.production("forvar : WORD")
@pg.production("expression : WORD")
@pg.production("variable : WORD")
def word_expr(p):
Expand Down

0 comments on commit ab91aad

Please sign in to comment.