Skip to content

Commit

Permalink
Fix the types
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Nov 17, 2021
1 parent bf28cbd commit 28f7a73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grammar/asdl_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def visitSum(self, sum, base):
self.emit("")
for i, cons in enumerate(sum.types):
self.emit("class %s(%s): # Type" % (cons.name, base))
self.emit( "ntype = 99", 1)
self.emit( "pass", 1)
self.emit("")
self.emit("")
Expand Down Expand Up @@ -309,7 +310,7 @@ def make_visitor(self, name, fields, cons):

def make_simple_sum_visitor(self, name, types):
self.emit("def visit_%s(self, x: %s):" % (name, name), 1)
self.emit( 'self.write_int8(x)', 2)
self.emit( 'self.write_int8(x.ntype)', 2)

def visitField(self, field, cons, cons_name):
if (field.type not in asdl.builtin_types and
Expand Down

0 comments on commit 28f7a73

Please sign in to comment.