Skip to content

Commit

Permalink
Merge branch 'pyccel:devel' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne authored Mar 8, 2024
2 parents e3c5b60 + 18be84d commit 43ecdd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions developer_docs/codegen_stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def _print_ClassName(self, stmt):
return Y
```
where `Y` must be a string.
Each of these `_print_X` functions should internally call the `_print` function on each of the elements of the object to obtain strings which can be combined to create a string describing the current object in the target language.
It can be tempting to skip some of these `_print` calls, especially for basic types such as literals.
Each of these `_print_X` functions should internally call the `_print` function on each of the `PyccelAstNode` elements of the object to obtain strings which can be combined to create a string describing the current object in the target language.
It can be tempting to skip some of these `_print` calls, especially for basic types such as `Literal`s.
However it is very important to use these functions as much as possible, for several reasons:
1. It ensures that the same conventions are used throughout the generated code
2. It ensures that code details are not forgotten
Expand Down
2 changes: 1 addition & 1 deletion pyccel/codegen/printing/pycode.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _print_NativeComplex(self, expr):
return 'complex'

def _print_Variable(self, expr):
return self._print(expr.name)
return expr.name

def _print_DottedVariable(self, expr):
rhs_code = self._print_Variable(expr)
Expand Down

0 comments on commit 43ecdd8

Please sign in to comment.