Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
97da923d
Commit
97da923d
authored
Jul 07, 2014
by
Maxime Perrotin
Browse files
Minor code cleanup
parent
3568bd8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
AdaGenerator.py
View file @
97da923d
...
...
@@ -722,11 +722,6 @@ def expression(expr):
def
_primary_variable
(
prim
):
''' Single variable reference '''
sep
=
u
'l_'
if
find_var
(
prim
.
value
[
0
])
else
u
''
# ada_string = u'{opnot}{sep}{name}'.format(
# opnot='not ' if prim.op_not else '',
# sep=sep, name=prim.value[0])
# if prim.op_minus:
# ada_string = '(-{})'.format(ada_string)
string
=
u
'{sep}{name}'
.
format
(
sep
=
sep
,
name
=
prim
.
value
[
0
])
ada_string
=
unary
(
prim
,
string
)
...
...
@@ -902,10 +897,6 @@ def _prim_path(primary_id):
ada_string
+=
')'
sep
=
'.'
ada_string
=
unary
(
primary_id
,
ada_string
)
# if primary_id.op_not:
# ada_string = 'not {}'.format(ada_string)
# elif primary_id.op_minus:
# ada_string = '(-{})'.format(ada_string)
return
stmts
,
ada_string
,
local_decl
...
...
@@ -1101,12 +1092,6 @@ def _integer(primary):
''' Generate code for a raw numerical value '''
ada_string
=
primary
.
value
[
0
]
ada_string
=
unary
(
primary
,
ada_string
)
# if primary.op_minus and float(ada_string) >= 0:
# ada_string = '(-{})'.format(ada_string)
# elif float(ada_string) < 0:
# ada_string = '({})'.format(ada_string)
# if primary.op_not:
# ada_string = 'not {}'.format(ada_string)
return
[],
ada_string
,
[]
...
...
@@ -1115,8 +1100,6 @@ def _integer(primary):
''' Generate code for a raw boolean value '''
ada_string
=
primary
.
value
[
0
]
ada_string
=
unary
(
primary
,
ada_string
)
# if primary.op_not:
# ada_string = 'not {}'.format(ada_string)
return
[],
ada_string
,
[]
...
...
ogParser.py
View file @
97da923d
...
...
@@ -1436,6 +1436,9 @@ def expression(root, context):
if
root
.
type
==
lexer
.
PRIMARY
:
expr
,
err
,
warn
=
primary
(
root
,
context
)
if
not
expr
:
expr
=
ogAST
.
Primary
()
errors
.
append
(
'Unable to parse primary - Check the syntax'
)
expr
.
inputString
=
get_input_string
(
root
)
expr
.
line
=
root
.
getLine
()
expr
.
charPositionInLine
=
root
.
getCharPositionInLine
()
...
...
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