Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
effcdda4
Commit
effcdda4
authored
Feb 27, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug that printed the output twice after a rewrite operation.
parent
7ecb7c78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/parser.py
src/parser.py
+6
-6
No files found.
src/parser.py
View file @
effcdda4
...
@@ -259,6 +259,7 @@ class Parser(BisonParser):
...
@@ -259,6 +259,7 @@ class Parser(BisonParser):
"""
"""
input :
input :
| input line
| input line
| input REWRITE NEWLINE
"""
"""
if
option
==
1
:
if
option
==
1
:
# Interactive mode is enabled if the term rewriting system is used
# Interactive mode is enabled if the term rewriting system is used
...
@@ -269,6 +270,10 @@ class Parser(BisonParser):
...
@@ -269,6 +270,10 @@ class Parser(BisonParser):
return
values
[
1
]
return
values
[
1
]
if
option
==
2
:
# rule: input REWRITE NEWLINE
self
.
root_node
=
self
.
rewrite
()
return
self
.
root_node
def
on_line
(
self
,
target
,
option
,
names
,
values
):
def
on_line
(
self
,
target
,
option
,
names
,
values
):
"""
"""
line : NEWLINE
line : NEWLINE
...
@@ -276,7 +281,6 @@ class Parser(BisonParser):
...
@@ -276,7 +281,6 @@ class Parser(BisonParser):
| debug NEWLINE
| debug NEWLINE
| HINT NEWLINE
| HINT NEWLINE
| POSSIBILITIES NEWLINE
| POSSIBILITIES NEWLINE
| REWRITE NEWLINE
| RAISE NEWLINE
| RAISE NEWLINE
"""
"""
if
option
==
1
:
# rule: EXP NEWLINE
if
option
==
1
:
# rule: EXP NEWLINE
...
@@ -295,11 +299,7 @@ class Parser(BisonParser):
...
@@ -295,11 +299,7 @@ class Parser(BisonParser):
self
.
display_possibilities
()
self
.
display_possibilities
()
return
return
if
option
==
5
:
# rule: REWRITE NEWLINE
if
option
==
5
:
self
.
root_node
=
self
.
rewrite
()
return
self
.
root_node
if
option
==
6
:
raise
RuntimeError
(
'on_line: exception raised'
)
raise
RuntimeError
(
'on_line: exception raised'
)
def
on_debug
(
self
,
target
,
option
,
names
,
values
):
def
on_debug
(
self
,
target
,
option
,
names
,
values
):
...
...
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