Commit bf4a8f0c authored by Igor Dejanovic's avatar Igor Dejanovic

Changing EOF rule name in PEG grammars

parent cf7876a8
......@@ -89,7 +89,7 @@ class SemRule(PEGSemanticAction):
if not hasattr(parser, "peg_rules"):
parser.peg_rules = {} # Used for linking phase
parser.peg_rules["EndOfFile"] = EndOfFile()
parser.peg_rules["EOF"] = EndOfFile()
# Keep a map of parser rules for cross reference
# resolving.
......
......@@ -27,7 +27,7 @@ calc_grammar = """
(number / "(" expression ")");
term <- factor (( "*" / "/") factor)*;
expression <- term (("+" / "-") term)*;
calc <- expression+ EndOfFile;
calc <- expression+ EOF;
"""
# Rules are mapped to semantic actions
......
......@@ -26,7 +26,7 @@ from arpeggio.peg import ParserPEG
# Grammar rules
robot_grammar = '''
program <- 'begin' (command)* 'end' EndOfFile;
program <- 'begin' (command)* 'end' EOF;
command <- UP/DOWN/LEFT/RIGHT;
UP <- 'up';
DOWN <- 'down';
......
......@@ -17,7 +17,7 @@ grammar = '''
(number / "(" expression ")");
term <- factor (( "*" / "/") factor)*;
expression <- term (("+" / "-") term)*;
calc <- expression+ EndOfFile;
calc <- expression+ EOF;
'''
class TestPEGParser(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment