aboutsummaryrefslogtreecommitdiff
path: root/neb
diff options
context:
space:
mode:
authormryouse2022-07-15 00:43:13 +0000
committermryouse2022-07-15 00:43:13 +0000
commit55abb4a0ed18b7e1314ca72842caeaae9d21693b (patch)
treebbf92710bdeabfd261ab6c1f069d6a1e9e17ae38 /neb
parent51e4d45bbabbc08cbb82464ab66a74c2779caaf5 (diff)
add quoted support to Symbol
Diffstat (limited to 'neb')
-rw-r--r--neb/structs.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/neb/structs.py b/neb/structs.py
index db74106..27c7782 100644
--- a/neb/structs.py
+++ b/neb/structs.py
@@ -116,12 +116,16 @@ _native_types = ":any :literal :string :bool :number :int :float :[] :handle :ty
ALL_TYPES = {x: Type(x) for x in _native_types.split(" ")}
class Symbol:
- def __init__(self, name, line):
+ def __init__(self, name, line, quoted=False):
self.name = name
self.line = line
+ self.quoted = quoted
self.type_ = ALL_TYPES[":any"] # TODO no it's not
def __str__(self):
- return f"{self.name}"
+ if self.quoted:
+ return f"'{self.name}"
+ else:
+ return f"{self.name}"
class Expr:
def __init__(self, args):