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
4c003ee2
Commit
4c003ee2
authored
Dec 12, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed typo in node.py
parent
ad9cff6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/node.py
src/node.py
+2
-3
No files found.
src/node.py
View file @
4c003ee2
...
@@ -12,7 +12,6 @@ TYPE_OPERATOR = 1
...
@@ -12,7 +12,6 @@ TYPE_OPERATOR = 1
TYPE_IDENTIFIER
=
2
TYPE_IDENTIFIER
=
2
TYPE_INTEGER
=
4
TYPE_INTEGER
=
4
TYPE_FLOAT
=
8
TYPE_FLOAT
=
8
TYPE_NUMERIC
=
TYPE_INTEGER
|
TYPE_FLOAT
# Unary
# Unary
...
@@ -39,7 +38,7 @@ TYPE_MAP = {
...
@@ -39,7 +38,7 @@ TYPE_MAP = {
OP_MAP
=
{
OP_MAP
=
{
'+'
:
OP_ADD
,
'+'
:
OP_ADD
,
# Either subst
itu
tion or negation. Skip the operator sign in 'x' (= 2).
# Either subst
rac
tion or negation. Skip the operator sign in 'x' (= 2).
'-'
:
lambda
x
:
OP_SUB
if
len
(
x
)
>
2
else
OP_NEG
,
'-'
:
lambda
x
:
OP_SUB
if
len
(
x
)
>
2
else
OP_NEG
,
'*'
:
OP_MUL
,
'*'
:
OP_MUL
,
'/'
:
OP_DIV
,
'/'
:
OP_DIV
,
...
@@ -131,7 +130,7 @@ class ExpressionLeaf(Leaf):
...
@@ -131,7 +130,7 @@ class ExpressionLeaf(Leaf):
return
self
.
type
&
TYPE_FLOAT
return
self
.
type
&
TYPE_FLOAT
def
is_numeric
(
self
):
def
is_numeric
(
self
):
return
self
.
type
&
TYPE_NUMERIC
return
self
.
type
&
(
TYPE_FLOAT
|
TYPE_INTEGER
)
if
__name__
==
'__main__'
:
# pragma: nocover
if
__name__
==
'__main__'
:
# pragma: nocover
...
...
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