From 55abb4a0ed18b7e1314ca72842caeaae9d21693b Mon Sep 17 00:00:00 2001 From: mryouse Date: Fri, 15 Jul 2022 00:43:13 +0000 Subject: add quoted support to Symbol --- neb/structs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'neb/structs.py') 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): -- cgit v1.2.3