Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
bf4a8f0c
Commit
bf4a8f0c
authored
Jul 13, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing EOF rule name in PEG grammars
parent
cf7876a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
peg.py
arpeggio/peg.py
+1
-1
calc_peg.py
examples/calc_peg.py
+1
-1
robot_peg.py
examples/robot_peg.py
+1
-1
test_peg_parser.py
tests/unit/test_peg_parser.py
+1
-1
No files found.
arpeggio/peg.py
View file @
bf4a8f0c
...
...
@@ -89,7 +89,7 @@ class SemRule(PEGSemanticAction):
if
not
hasattr
(
parser
,
"peg_rules"
):
parser
.
peg_rules
=
{}
# Used for linking phase
parser
.
peg_rules
[
"E
ndOfFile
"
]
=
EndOfFile
()
parser
.
peg_rules
[
"E
OF
"
]
=
EndOfFile
()
# Keep a map of parser rules for cross reference
# resolving.
...
...
examples/calc_peg.py
View file @
bf4a8f0c
...
...
@@ -27,7 +27,7 @@ calc_grammar = """
(number / "(" expression ")");
term <- factor (( "*" / "/") factor)*;
expression <- term (("+" / "-") term)*;
calc <- expression+ E
ndOfFile
;
calc <- expression+ E
OF
;
"""
# Rules are mapped to semantic actions
...
...
examples/robot_peg.py
View file @
bf4a8f0c
...
...
@@ -26,7 +26,7 @@ from arpeggio.peg import ParserPEG
# Grammar rules
robot_grammar
=
'''
program <- 'begin' (command)* 'end' E
ndOfFile
;
program <- 'begin' (command)* 'end' E
OF
;
command <- UP/DOWN/LEFT/RIGHT;
UP <- 'up';
DOWN <- 'down';
...
...
tests/unit/test_peg_parser.py
View file @
bf4a8f0c
...
...
@@ -17,7 +17,7 @@ grammar = '''
(number / "(" expression ")");
term <- factor (( "*" / "/") factor)*;
expression <- term (("+" / "-") term)*;
calc <- expression+ E
ndOfFile
;
calc <- expression+ E
OF
;
'''
class
TestPEGParser
(
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment