11# -*- coding: utf-8 -*-
22# Operators implemented in the preprocessor
33
4-
5- from src .zxbpp import prepro
64from src .zxbpp .prepro .macrocall import MacroCall
5+ from src .zxbpp .prepro import DefinesTable
76
87
98class Concatenation (MacroCall ):
@@ -13,12 +12,12 @@ class Concatenation(MacroCall):
1312 Out of a macro body, ID1 and ID2 are expanded normally and "##" is
1413 also output as is.
1514 """
16- def __init__ (self , fname : str , lineno : int , table : 'prepro. DefinesTable' , left : MacroCall , right : MacroCall ):
15+ def __init__ (self , fname : str , lineno : int , table : DefinesTable , left : MacroCall , right : MacroCall ):
1716 super ().__init__ (fname = fname , lineno = lineno , table = table , id_ = '' )
1817 self .left = left
1918 self .right = right
2019
21- def __call__ (self , symbolTable : 'prepro. DefinesTable' = None ) -> str :
20+ def __call__ (self , symbolTable : DefinesTable = None ) -> str :
2221 return self .left (symbolTable ).rstrip () + self .right (symbolTable ).lstrip ()
2322
2423
@@ -27,7 +26,7 @@ class Stringizing(MacroCall):
2726 macrocall into a BASIC string (double quotes " as delimiters, escaped as
2827 doubled-double quote 'Hello "dear"' => 'Hello ""dear""').
2928 """
30- def __init__ (self , fname : str , lineno : int , table : 'prepro. DefinesTable' , macro_call : MacroCall ):
29+ def __init__ (self , fname : str , lineno : int , table : DefinesTable , macro_call : MacroCall ):
3130 super ().__init__ (fname = fname , lineno = lineno , table = table , id_ = '' )
3231 self .macro_call = macro_call
3332
@@ -36,5 +35,5 @@ def stringize(s: str) -> str:
3635 s = s .replace ('"' , '""' )
3736 return f'"{ s } "'
3837
39- def __call__ (self , symbolTable : 'prepro. DefinesTable' = None ) -> str :
38+ def __call__ (self , symbolTable : DefinesTable = None ) -> str :
4039 return self .stringize (self .macro_call (symbolTable ))
0 commit comments