diff options
Diffstat (limited to 'Parser/asdl.py')
-rw-r--r-- | Parser/asdl.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Parser/asdl.py b/Parser/asdl.py index 62f5c19..5416377 100644 --- a/Parser/asdl.py +++ b/Parser/asdl.py @@ -72,6 +72,16 @@ class Field(AST): self.seq = seq self.opt = opt + def __str__(self): + if self.seq: + extra = "*" + elif self.opt: + extra = "?" + else: + extra = "" + + return "{}{} {}".format(self.type, extra, self.name) + def __repr__(self): if self.seq: extra = ", seq=True" |