File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ All notable changes to this project will be documented in this file.
79
79
- #2008 : Ensure list/set/dict assignment is recognised as a reference.
80
80
- #2039 : Ensure any expressions in the iterable of a for loop are calculated before the loop.
81
81
- #2013 : Stop limiting the length of strings to 128 characters.
82
+ - #2078 : Fix translation of classes containing comments.
82
83
83
84
### Changed
84
85
Original file line number Diff line number Diff line change @@ -1030,7 +1030,9 @@ def _visit_ClassDef(self, stmt):
1030
1030
if isinstance (visited_i , FunctionDef ):
1031
1031
methods .append (visited_i )
1032
1032
visited_i .arguments [0 ].bound_argument = True
1033
- elif isinstance (visited_i , Pass ):
1033
+ elif isinstance (visited_i , (Pass , Comment )):
1034
+ continue
1035
+ elif isinstance (visited_i , CodeBlock ) and all (isinstance (x , Comment ) for x in visited_i .body ):
1034
1036
continue
1035
1037
elif isinstance (visited_i , AnnotatedPyccelSymbol ):
1036
1038
attributes .append (visited_i )
Original file line number Diff line number Diff line change @@ -6,15 +6,20 @@ def __init__(self, x : 'float[:]'):
6
6
self ._X = 10
7
7
self ._x = x
8
8
9
+ #--------------------------------------
9
10
def __del__ (self ):
10
11
pass
11
12
13
+ #--------------------------------------
12
14
def translate (self , a : 'float[:]' ):
13
15
self ._x [:] = self ._x + a
14
16
17
+ #--------------------------------------
15
18
def get_x (self ):
16
19
return self ._x
17
20
21
+ #--------------------------------------
22
+ #--------------------------------------
18
23
def get_X (self ):
19
24
return self ._X
20
25
You can’t perform that action at this time.
0 commit comments