Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
f4be252b
Commit
f4be252b
authored
Apr 25, 2018
by
Martin Bauer
Browse files
Removed unnecessary whitespaces from generated code
parent
53caa7e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
backends/cbackend.py
View file @
f4be252b
...
...
@@ -161,8 +161,8 @@ class CBackend:
def
_print_SympyAssignment
(
self
,
node
):
if
node
.
is_declaration
:
data_type
=
"const "
+
str
(
node
.
lhs
.
dtype
)
+
" "
if
node
.
is_const
else
str
(
node
.
lhs
.
dtype
)
+
" "
return
"%s
%s = %s;"
%
(
data_type
,
self
.
sympy_printer
.
doprint
(
node
.
lhs
),
self
.
sympy_printer
.
doprint
(
node
.
rhs
))
return
"%s%s = %s;"
%
(
data_type
,
self
.
sympy_printer
.
doprint
(
node
.
lhs
),
self
.
sympy_printer
.
doprint
(
node
.
rhs
))
else
:
lhs_type
=
get_type_of_expression
(
node
.
lhs
)
if
type
(
lhs_type
)
is
VectorType
and
node
.
lhs
.
func
==
cast_func
:
...
...
data_types.py
View file @
f4be252b
...
...
@@ -461,7 +461,12 @@ class PointerType(Type):
return
(
self
.
base_type
,
self
.
const
,
self
.
restrict
)
==
(
other
.
base_type
,
other
.
const
,
other
.
restrict
)
def
__str__
(
self
):
return
"%s *%s%s"
%
(
self
.
base_type
,
" RESTRICT "
if
self
.
restrict
else
""
,
" const "
if
self
.
const
else
""
)
components
=
[
str
(
self
.
base_type
),
'*'
]
if
self
.
restrict
:
components
.
append
(
'RESTRICT'
)
if
self
.
const
:
components
.
append
(
"const"
)
return
" "
.
join
(
components
)
def
__repr__
(
self
):
return
str
(
self
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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