.NamedType string (None) Optional [ NamedType string (None) ] Dict [ NamedType string (None), NamedType int (None) ] Module arith { Use asdl examples demo_lib { value } Type op_id { Sum { Constructor Plus Constructor Minus Constructor Star } } Type op_array { Product { Field 'ops' List [ NamedType op_id (None) ] } } Type assign { Product { Field 'name' NamedType string (None) Field 'flags' List [ NamedType string (None) ] } } Type cflow { Sum { Constructor Break Constructor Continue Constructor Return { Field 'status' NamedType int (None) } } } Type source_location { Product { Field 'path' NamedType string (None) Field 'line' NamedType int (None) Field 'col' NamedType int (None) Field 'length' NamedType int (None) } } Type word { Product { Field 'value' NamedType string (None) } } Type bool_expr { Sum { Constructor Binary { Field 'left' NamedType word (None) Field 'right' NamedType word (None) } Constructor Unary { Field 'child' NamedType word (None) } Constructor LogicalNot { Field 'b' NamedType bool_expr (None) } Constructor LogicalBinary { Field 'op' NamedType op_id (None) Field 'left' NamedType bool_expr (None) Field 'right' NamedType bool_expr (None) } } } Type Token { Product { Field 's' NamedType string (None) Field 'b' NamedType bool (None) } } Type cflow2 { Sum { Constructor Break Constructor Continue Constructor Return { Field 'status' NamedType int (None) } } } Type Dicts { Product { Field 'ss' Dict [ NamedType string (None), NamedType string (None) ] Field 'ib' Dict [ NamedType int (None), NamedType bool (None) ] Field 'tokens' Dict [ NamedType string (None), NamedType Token (None) ] } } Type flag_type { Sum { Constructor Bool Constructor Int Constructor Float Constructor Str Constructor Enum { Field 'alts' List [ NamedType string (None) ] } } } Type SetToArg_ { Product { Field 'name' NamedType string (None) Field 'flag_type' NamedType flag_type (None) Field 'quit_parsing_flags' NamedType bool (None) } } Type Strings { Product { Field 'required' NamedType string (None) Field 'optional' Optional [ NamedType string (None) ] } } Type Maybes { Product { Field 'op' Optional [ NamedType Token (None) ] Field 'arg' Optional [ NamedType word (None) ] } } Type OptionalList { Product { Field 'words' Optional [ List [ NamedType word (None) ] ] } } } Module arith { Use asdl examples demo_lib { value } Type op_id { Sum { Constructor Plus Constructor Minus Constructor Star } } Type op_array { Product { Field 'ops' List [ NamedType op_id () ] } } Type assign { Product { Field 'name' NamedType string (None) Field 'flags' List [ NamedType string (None) ] } } Type cflow { Sum { Constructor Break Constructor Continue Constructor Return { Field 'status' NamedType int (None) } } } Type source_location { Product { Field 'path' NamedType string (None) Field 'line' NamedType int (None) Field 'col' NamedType int (None) Field 'length' NamedType int (None) } } Type word { Product { Field 'value' NamedType string (None) } } Type bool_expr { Sum { Constructor Binary { Field 'left' NamedType word () Field 'right' NamedType word () } Constructor Unary { Field 'child' NamedType word () } ... Constructor LogicalNot { Field 'b' NamedType bool_expr () } Constructor LogicalBinary { Field 'op' NamedType op_id () Field 'left' NamedType bool_expr () Field 'right' NamedType bool_expr () } } } Type Token { Product { Field 's' NamedType string (None) Field 'b' NamedType bool (None) } } Type cflow2 { Sum { Constructor Break Constructor Continue Constructor Return { Field 'status' NamedType int (None) } } } Type Dicts { Product { Field 'ss' Dict [ NamedType string (None), NamedType string (None) ] Field 'ib' Dict [ NamedType int (None), NamedType bool (None) ] Field 'tokens' Dict [ NamedType string (None), NamedType Token () ] } } Type flag_type { Sum { Constructor Bool Constructor Int Constructor Float Constructor Str Constructor Enum { Field 'alts' List [ NamedType string (None) ] } } } Type SetToArg_ { Product { Field 'name' NamedType string (None) Field 'flag_type' NamedType flag_type () Field 'quit_parsing_flags' NamedType bool (None) } } Type Strings { Product { Field 'required' NamedType string (None) Field 'optional' Optional [ NamedType string (None) ] } } Type Maybes { Product { Field 'op' Optional [ NamedType Token () ] Field 'arg' Optional [ NamedType word () ] } } Type OptionalList { Product { Field 'words' Optional [ List [ NamedType word () ] ] } } } Module foo { Type point { Product { Field 'x' Optional [ NamedType int (None) ] Field 'y' List [ NamedType int (None) ] } } Type action { Sum { Constructor Foo Constructor Bar { Field 'z' NamedType point (None) } } } Type foo { Product { Field 'span_ids' List [ NamedType int (None) ] } } Type bar { Product { Field 'options' Dict [ NamedType string (None), NamedType int (None) ] } } Type does_not_resolve { Product { Field 'zz' NamedType typo (None) } } Type color { Sum { Constructor Red Constructor Green } } Type color2 { Sum { Constructor Red Constructor Green } } Type color3 { Sum { Constructor Red Constructor Green generate ['integers'] } } Type color4 { Sum { Constructor Blue Constructor Purple generate ['uint16'] } } Type spam { Product { Field 'pipe_status' Optional [ List [ NamedType int (None) ] ] } } Type spam2 { Product { Field 'pipe_status' Optional [ List [ NamedType int (None) ] ] } } } Syntax error on line 1: Expected token Name, got ) Syntax error on line 1: Expected 1 type param to List Syntax error on line 1: Expected zero type params to string Syntax error on line 1: Expected token Name, got ] Syntax error on line 1: Expected 2 type params to Dict Syntax error on line 1: Expected token Name, got ] Syntax error on line 1: Expected token RBrace, got ( Syntax error on line 1: Invalid operator : Syntax error on line 1: Expected token LBracket, got } Syntax error on line 1: Expected token RBracket, got , Syntax error on line 1: Invalid code gen option 'invalid' Module foo { Type point { Product { Field 'x' NamedType int (None) Field 'y' NamedType int (None) } } Type place { Sum { Constructor None Constructor Two { Field 'a' NamedType point () Field 'b' NamedType point () } } } Type options { Product { Field 'names' Dict [ NamedType string (None), NamedType int (None) ] } } } Syntax error on line : Couldn't find type 'typo' Syntax error on line : Optional primitive type int not allowed Syntax error on line : Optional simple sum type color not allowed Module shared_variant { Type prod { Product { Field 'a' NamedType string (None) Field 'b' NamedType string (None) } } Type DoubleQuoted { Product { Field 'left' NamedType int (None) Field 'tokens' List [ NamedType string (None) ] } } Type expr { Sum { Constructor Binary { Field 'left' NamedType expr () Field 'right' NamedType expr () } Constructor DoubleQuoted %DoubleQuoted } } Type Token { Product { Field 'id' NamedType int (None) Field 'val' NamedType string (None) } } Type tok { Sum { Constructor Eof Constructor Token %Token } } Type tok_struct { Product { Field 'token' NamedType tok () Field 'x' NamedType int (None) } } Type tok_array { Product { Field 'tokens' List [ NamedType tok () ] } } Type word_part { Sum { Constructor Literal { Field 's' NamedType string (None) } Constructor DoubleQuoted %DoubleQuoted } } Type cflow { Sum { Constructor Break Constructor Continue Constructor Return { Field 'val' NamedType int (None) } } } } (DoubleQuoted left:5 tokens:[foo bar]) (expr.Binary left:(DoubleQuoted left:5 tokens:[foo bar]) right:...0x7fcc35112050)