Skip to content

Commit

Permalink
feat(ParserBase): add support for for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
aadhithya committed May 16, 2022
1 parent 78cc1da commit 70a49d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rajinipp/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ..ast.base import Expression, Print
from ..ast.blocks import MainBlock
from .atom_parser import AtomParser
from .cond_parser import ConditionalParser
from .expr_parser import ExpressionParser
from .flow_parser import ConditionalParser, LoopParser
from .ops_parser import BinaryLogicalOpsParser, BinaryMathOpsParser
from .print_parser import PrintParser
from .stmt_parser import StatementParser
Expand All @@ -34,6 +34,7 @@ def __init__(self, tokens: List[str]) -> None:
BinaryMathOpsParser(),
BinaryLogicalOpsParser(),
ConditionalParser(),
LoopParser(),
PrintParser(),
VariableParser(),
AtomParser(),
Expand Down Expand Up @@ -74,6 +75,8 @@ def __init__(self, tokens: List[str]) -> None:
self.parsers.pop(0)
# * remove ConditionalParser. Line Parser will not support it yet.
self.parsers.pop(3)
# * remove LoopParser. Line Parser will not support it yet.
self.parsers.pop(3)

def parse(self):
@self.pg.production("statement : PRINT printexprs SEMI_COLON")
Expand Down

0 comments on commit 70a49d3

Please sign in to comment.