File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Scope:
2929
3030 The caseins dict stores the symbol names in lowercase only if
3131 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
3333 as a fallback if the symbol name does not exists.
3434
3535 On init() the parent mangle can be stored. The mangle is a prefix
@@ -55,7 +55,7 @@ def __getitem__(self, key: str) -> Optional[SymbolVAR]:
5555 def __setitem__ (self , key : str , value : SymbolVAR ):
5656 assert isinstance (value , Symbol )
5757 self .symbols [key ] = value
58- if value .caseins : # Declared with case insensitive option?
58+ if value .caseins : # Declared with case- insensitive option?
5959 self .caseins [key .lower ()] = value
6060
6161 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):
165165 asm_output = "\n " .join (asm_output )
166166
167167 # Now filter them against the preprocessor again
168- zxbpp .setMode ("asm" )
168+ zxbpp .setMode (zxbpp . PreprocMode . ASM )
169169 zxbpp .OUTPUT = ""
170170 zxbpp .filter_ (asm_output , filename = input_filename )
171171
Original file line number Diff line number Diff line change 2828import src .api .symboltable .symboltable
2929from src .api .debug import __DEBUG__ # analysis:ignore
3030from src .api .opcodestemps import OpcodesTemps
31- from src .api .errmsg import error
31+ from src .api .errmsg import error , warning_condition_is_always
3232from src .api .errmsg import warning
3333from src .api .global_ import LoopInfo
3434
@@ -1869,11 +1869,8 @@ def p_while_sentence(p):
18691869 gl .LOOPS .pop ()
18701870 q = make_block (p [2 ], p [3 ])
18711871
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 ))
18771874
18781875 p [0 ] = make_sentence (p .lineno (1 ), "WHILE" , p [1 ], q )
18791876
You can’t perform that action at this time.
0 commit comments