File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Scope:
29
29
30
30
The caseins dict stores the symbol names in lowercase only if
31
31
the global OPTION ignore case is enabled (True). This is because
32
- most BASIC dialects are case insensitive. 'caseins' will be used
32
+ most BASIC dialects are case- insensitive. 'caseins' will be used
33
33
as a fallback if the symbol name does not exists.
34
34
35
35
On init() the parent mangle can be stored. The mangle is a prefix
@@ -55,7 +55,7 @@ def __getitem__(self, key: str) -> Optional[SymbolVAR]:
55
55
def __setitem__ (self , key : str , value : SymbolVAR ):
56
56
assert isinstance (value , Symbol )
57
57
self .symbols [key ] = value
58
- if value .caseins : # Declared with case insensitive option?
58
+ if value .caseins : # Declared with case- insensitive option?
59
59
self .caseins [key .lower ()] = value
60
60
61
61
def __delitem__ (self , key : str ):
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def main(args=None, emitter=None):
165
165
asm_output = "\n " .join (asm_output )
166
166
167
167
# Now filter them against the preprocessor again
168
- zxbpp .setMode ("asm" )
168
+ zxbpp .setMode (zxbpp . PreprocMode . ASM )
169
169
zxbpp .OUTPUT = ""
170
170
zxbpp .filter_ (asm_output , filename = input_filename )
171
171
Original file line number Diff line number Diff line change 28
28
import src .api .symboltable .symboltable
29
29
from src .api .debug import __DEBUG__ # analysis:ignore
30
30
from src .api .opcodestemps import OpcodesTemps
31
- from src .api .errmsg import error
31
+ from src .api .errmsg import error , warning_condition_is_always
32
32
from src .api .errmsg import warning
33
33
from src .api .global_ import LoopInfo
34
34
@@ -1869,11 +1869,8 @@ def p_while_sentence(p):
1869
1869
gl .LOOPS .pop ()
1870
1870
q = make_block (p [2 ], p [3 ])
1871
1871
1872
- if is_number (p [1 ]) and p [1 ].value :
1873
- if q is None :
1874
- warning (p [1 ].lineno , "Condition is always true and leads to an infinite loop." )
1875
- else :
1876
- warning (p [1 ].lineno , "Condition is always true and might lead to an infinite loop." )
1872
+ if is_number (p [1 ]):
1873
+ warning_condition_is_always (p .lineno (1 ), bool (p [1 ].value ))
1877
1874
1878
1875
p [0 ] = make_sentence (p .lineno (1 ), "WHILE" , p [1 ], q )
1879
1876
You can’t perform that action at this time.
0 commit comments