Skip to content

Commit

Permalink
Convert None to Env.null (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
smartycope authored Aug 16, 2024
1 parent 39af061 commit becbcfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyndustric/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,8 @@ def as_value(self, node, output: str = None):
return ("false", "true")[node.value]
elif isinstance(node.value, (int, float)):
return str(node.value)
elif node.value is None:
return "@null"
elif isinstance(node.value, str):
if (
len(str(node.value)) == 7 or len(str(node.value)) == 9
Expand Down
7 changes: 7 additions & 0 deletions test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,3 +1156,10 @@ def test_complex_compare():
op lessThan a a 15
"""
a = 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 14 < 15

@masm_test
def test_None():
"""
set foo @null
"""
foo = None

0 comments on commit becbcfa

Please sign in to comment.