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
84753e44
Commit
84753e44
authored
Feb 23, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some syntaxis fixes (applied pep8).
parent
41047c7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
src/node.py
src/node.py
+1
-1
src/parser.py
src/parser.py
+2
-2
src/rules/numerics.py
src/rules/numerics.py
+0
-1
No files found.
src/node.py
View file @
84753e44
...
@@ -90,7 +90,7 @@ TOKEN_MAP = {
...
@@ -90,7 +90,7 @@ TOKEN_MAP = {
OP_HINT
:
'HINT'
,
OP_HINT
:
'HINT'
,
OP_REWRITE_ALL
:
'REWRITE_ALL'
,
OP_REWRITE_ALL
:
'REWRITE_ALL'
,
OP_REWRITE
:
'REWRITE'
,
OP_REWRITE
:
'REWRITE'
,
}
}
def
to_expression
(
obj
):
def
to_expression
(
obj
):
...
...
src/parser.py
View file @
84753e44
...
@@ -51,8 +51,8 @@ class Parser(BisonParser):
...
@@ -51,8 +51,8 @@ class Parser(BisonParser):
# ----------------------------------------------------------------
# ----------------------------------------------------------------
# TODO: add a runtime check to verify that this token list match the list
# TODO: add a runtime check to verify that this token list match the list
# of tokens of the lex script.
# of tokens of the lex script.
tokens
=
[
'NUMBER'
,
'IDENTIFIER'
,
'NEWLINE'
,
'QUIT'
,
'RAISE'
,
'GRAPH'
,
\
tokens
=
[
'NUMBER'
,
'IDENTIFIER'
,
'NEWLINE'
,
'QUIT'
,
'RAISE'
,
'GRAPH'
,
\
'LPAREN'
,
'RPAREN'
]
+
TOKEN_MAP
.
values
()
'LPAREN'
,
'RPAREN'
]
+
TOKEN_MAP
.
values
()
# ------------------------------
# ------------------------------
# precedences
# precedences
...
...
src/rules/numerics.py
View file @
84753e44
...
@@ -219,7 +219,6 @@ def multiply_numerics(root, args):
...
@@ -219,7 +219,6 @@ def multiply_numerics(root, args):
"""
"""
scope
,
c0
,
c1
=
args
scope
,
c0
,
c1
=
args
# Replace the left node with the new expression
# Replace the left node with the new expression
substitution
=
Leaf
(
c0
.
value
*
c1
.
value
).
negate
(
c0
.
negated
+
c1
.
negated
)
substitution
=
Leaf
(
c0
.
value
*
c1
.
value
).
negate
(
c0
.
negated
+
c1
.
negated
)
scope
.
replace
(
c0
,
substitution
)
scope
.
replace
(
c0
,
substitution
)
...
...
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