🐐 Numbers as strings when needed
This commit is contained in:
@@ -418,9 +418,14 @@ class BinOp(Node):
|
||||
return vtable, ValNul()
|
||||
return vtable, ValInt((lv or 0) + (rv or 0))
|
||||
case "SYMBOL_COLON":
|
||||
lv = lv if lv is not None else ""
|
||||
rv = rv if rv is not None else ""
|
||||
return vtable, ValStr(lv + rv)
|
||||
magnvm = "MAGNVM" in vtable["#modules"]
|
||||
svbnvlla = "SVBNVLLA" in vtable["#modules"]
|
||||
def _coerce(v):
|
||||
if v is None: return ""
|
||||
if isinstance(v, bool): return "VERITAS" if v else "FALSITAS"
|
||||
if isinstance(v, int): return int_to_num(v, magnvm, svbnvlla)
|
||||
return v
|
||||
return vtable, ValStr(_coerce(lv) + _coerce(rv))
|
||||
case "SYMBOL_MINUS":
|
||||
return vtable, ValInt((lv or 0) - (rv or 0))
|
||||
case "SYMBOL_TIMES":
|
||||
|
||||
Reference in New Issue
Block a user