diff options
Diffstat (limited to 'neb/structs.py')
| -rw-r--r-- | neb/structs.py | 8 |
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): |
