<s> import warnings <EOL> from collections import Sequence <EOL> import rply <EOL> from rply import ParserGenerator <EOL> from mochi import __version__ <EOL> name_seq = <NUM_LIT:0> <EOL> def get_temp_name ( ) : <EOL> global name_seq <EOL> name_seq += <NUM_LIT:1> <EOL> name_symbol = Symbol ( '<STR_LIT>' % name_seq ) <EOL> return name_symbol <EOL> class ParsingError ( Exception ) : <EOL> def __init__ ( self , file_path , lineno = <NUM_LIT:1> , colno = <NUM_LIT:1> ) : <EOL> self . file_path = file_path <EOL> self . lineno = lineno <EOL> self . colno = colno <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' + self . file_path + '<STR_LIT>' + str ( self . lineno ) + '<STR_LIT>' + str ( self . colno ) <EOL> def parse ( lexer , filename = "<STR_LIT>" ) : <EOL> try : <EOL> with warnings . catch_warnings ( ) : <EOL> warnings . simplefilter ( '<STR_LIT:ignore>' ) <EOL> return pg . build ( ) . parse ( lexer ) <EOL> except rply . errors . ParsingError as e : <EOL> source_pos = e . getsourcepos ( ) <EOL> if source_pos is None : <EOL> raise ParsingError ( filename ) <EOL> else : <EOL> raise ParsingError ( filename , <EOL> source_pos . lineno , <EOL> source_pos . colno ) <EOL> class Symbol ( object ) : <EOL> def __init__ ( self , name , lineno = <NUM_LIT:0> , col_offset = <NUM_LIT:0> ) : <EOL> self . name = name <EOL> self . outer_name = name <EOL> self . lineno = lineno <EOL> self . col_offset = col_offset <EOL> def eval ( self , env ) : <EOL> pass <EOL> def __repr__ ( self ) : <EOL> return self . outer_name <EOL> def __str__ ( self ) : <EOL> return self . outer_name <EOL> def __eq__ ( self , other ) : <EOL> if type ( other ) is not Symbol : <EOL> return False <EOL> if self . name == other . name : <EOL> return True <EOL> else : <EOL> return False <EOL> def __hash__ ( self ) : <EOL> return ( self . name . __hash__ ( ) << <NUM_LIT:16> ) + self . outer_name . __hash__ ( ) <EOL> class Keyword ( object ) : <EOL> def __init__ ( self , name , lineno = <NUM_LIT:0> , col_offset = <NUM_LIT:0> ) : <EOL> self . name = name <EOL> self . lineno = lineno <EOL> self . col_offset = col_offset <EOL> self . repr = '<STR_LIT::>' + self . name <EOL> def __repr__ ( self ) : <EOL> return self . repr <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> def __call__ ( self , table ) : <EOL> return table [ self . name ] <EOL> def __eq__ ( self , other ) : <EOL> if type ( other ) is not Keyword : <EOL> return False <EOL> if self . name == other . name : <EOL> return True <EOL> else : <EOL> return False <EOL> def __hash__ ( self ) : <EOL> return self . name . __hash__ ( ) <EOL> pg = ParserGenerator ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> precedence = [ ( '<STR_LIT:left>' , [ '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ( '<STR_LIT:left>' , [ '<STR_LIT>' ] ) ] , <EOL> cache_id = '<STR_LIT>' + __version__ ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def program ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def block ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def stmts_b ( p ) : <EOL> if p [ <NUM_LIT:1> ] is None : <EOL> return p [ <NUM_LIT:0> ] <EOL> else : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def stmts_stmt ( p ) : <EOL> if p [ <NUM_LIT:0> ] is None : <EOL> return [ ] <EOL> else : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def stmt_newline ( p ) : <EOL> pass <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def stmt ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def import_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def names ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def names_single ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def names ( p ) : <EOL> return Symbol ( '<STR_LIT:.>' . join ( p [ <NUM_LIT:0> ] ) ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def _names_one ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] . getstr ( ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def _names ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] . getstr ( ) [ <NUM_LIT:1> : ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def require_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def module_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:5> ] ] + p [ <NUM_LIT:6> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def export_cls_list ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def export_cls_list_one ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def export_cls ( p ) : <EOL> return p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def names ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def names_single ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def name ( p ) : <EOL> return token_to_symbol ( p [ <NUM_LIT:0> ] ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_elt ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def from_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def suite_expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def suite_stmts ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def suite2_stmts ( p ) : <EOL> return p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def try_finally_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:2> ] + [ p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def try_except_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:2> ] + p [ <NUM_LIT:3> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def try_excepts_finally_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:2> ] + p [ <NUM_LIT:3> ] + [ p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def except_cls_list ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def except_cls_list ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def except_cls ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , token_to_symbol ( p [ <NUM_LIT:3> ] ) ] + p [ <NUM_LIT:5> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def finally_cls ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def raise_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def macro_stmt ( p ) : <EOL> fun_name , fun_args = p [ <NUM_LIT:1> ] <EOL> return [ Symbol ( '<STR_LIT>' ) , fun_name , fun_args ] + p [ <NUM_LIT:3> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def q_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def quote_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def qq_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def quasi_quote_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def qq_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def qq_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def with_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] + p [ <NUM_LIT:3> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def with_contexts ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def with_contexts_one ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def with_context ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , token_to_symbol ( p [ <NUM_LIT:2> ] ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def raise_stmt ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> def token_to_symbol ( token ) : <EOL> return Symbol ( token . getstr ( ) , token . getsourcepos ( ) . lineno , token . getsourcepos ( ) . colno ) <EOL> def token_to_keyword ( token ) : <EOL> return Keyword ( token . getstr ( ) , token . getsourcepos ( ) . lineno , token . getsourcepos ( ) . colno ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def let_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:0> ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binding ( p ) : <EOL> return token_to_symbol ( p [ <NUM_LIT:0> ] ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def paren_expr ( p ) : <EOL> return p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_num ( p ) : <EOL> num_repr = p [ <NUM_LIT:0> ] . getstr ( ) <EOL> try : <EOL> return int ( num_repr ) <EOL> except ValueError as _ : <EOL> return float ( num_repr ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_string ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_quote_str ( p ) : <EOL> return quote_str ( p [ <NUM_LIT:0> ] . getstr ( ) [ <NUM_LIT:1> : - <NUM_LIT:1> ] ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_triple_quote_str ( p ) : <EOL> return quote_str ( p [ <NUM_LIT:0> ] . getstr ( ) [ <NUM_LIT:3> : - <NUM_LIT:3> ] ) <EOL> def quote_str ( string ) : <EOL> new_string = '<STR_LIT>' <EOL> string_enumerator = enumerate ( string ) <EOL> for index , char in string_enumerator : <EOL> if char == '<STR_LIT:\\>' : <EOL> index , char = next ( string_enumerator ) <EOL> if char == '<STR_LIT:n>' : <EOL> char = '<STR_LIT:\n>' <EOL> elif char == '<STR_LIT:t>' : <EOL> char = '<STR_LIT:\t>' <EOL> elif char == '<STR_LIT:r>' : <EOL> char = '<STR_LIT:\r>' <EOL> elif char in { '<STR_LIT:\\>' , "<STR_LIT:'>" , '<STR_LIT:">' } : <EOL> pass <EOL> else : <EOL> char = '<STR_LIT:\\>' + char <EOL> new_string = new_string + char <EOL> return new_string <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_quote_raw_str ( p ) : <EOL> return p [ <NUM_LIT:0> ] . getstr ( ) [ <NUM_LIT:2> : - <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_triple_quote_raw_str ( p ) : <EOL> return p [ <NUM_LIT:0> ] . getstr ( ) [ <NUM_LIT:4> : - <NUM_LIT:3> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_false ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_true ( p ) : <EOL> return Symbol ( '<STR_LIT:True>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def expr_false ( p ) : <EOL> return Symbol ( '<STR_LIT:False>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def id_expr ( p ) : <EOL> return token_to_symbol ( p [ <NUM_LIT:0> ] ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def id_expr ( p ) : <EOL> return Symbol ( '<STR_LIT:&>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def if_expr ( p ) : <EOL> if p [ <NUM_LIT:4> ] is None : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] ] <EOL> else : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] ] + p [ <NUM_LIT:4> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def if_else_expr ( p ) : <EOL> if p [ <NUM_LIT:4> ] is None : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] , p [ <NUM_LIT:7> ] ] <EOL> else : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] ] + p [ <NUM_LIT:4> ] + [ p [ <NUM_LIT:7> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def elseif_exprs ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def elseif_exprs_expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def elseif_expr ( p ) : <EOL> return [ p [ <NUM_LIT:1> ] , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def elseif_expr_empty ( p ) : <EOL> return None <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def trailing_if_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def yield_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def yield_from_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> def issequence ( obj ) : <EOL> return isinstance ( obj , Sequence ) <EOL> def issequence_except_str ( obj ) : <EOL> if isinstance ( obj , str ) : <EOL> return False <EOL> return isinstance ( obj , Sequence ) <EOL> def _compute_underscore_max_num ( exps ) : <EOL> max_num = <NUM_LIT:0> <EOL> if not issequence_except_str ( exps ) : <EOL> exps = ( exps , ) <EOL> for exp in exps : <EOL> if isinstance ( exp , Symbol ) and exp . name . startswith ( '<STR_LIT:$>' ) : <EOL> try : <EOL> n = int ( exp . name [ <NUM_LIT:1> : ] ) <EOL> except : <EOL> n = <NUM_LIT:1> <EOL> elif issequence_except_str ( exp ) : <EOL> n = _compute_underscore_max_num ( exp ) <EOL> else : <EOL> n = <NUM_LIT:0> <EOL> if n > max_num : <EOL> max_num = n <EOL> return max_num <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dot_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:1> ] . getstr ( ) [ <NUM_LIT:1> : ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def get_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def get_slice_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] , p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def get_slice_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] , p [ <NUM_LIT:4> ] , p [ <NUM_LIT:6> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def range_start_none ( p ) : <EOL> return Symbol ( '<STR_LIT:None>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def range_start_none ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dot_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] , p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def for_expr ( p ) : <EOL> pattern = p [ <NUM_LIT:3> ] <EOL> items = p [ <NUM_LIT:5> ] <EOL> body = p [ <NUM_LIT:1> ] <EOL> return [ Symbol ( '<STR_LIT>' ) , body , [ pattern , items ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def for_expr_if ( p ) : <EOL> pattern = p [ <NUM_LIT:3> ] <EOL> items = p [ <NUM_LIT:5> ] <EOL> body = p [ <NUM_LIT:1> ] <EOL> when = p [ <NUM_LIT:7> ] <EOL> return [ Symbol ( '<STR_LIT>' ) , body , [ pattern , items , Keyword ( '<STR_LIT>' ) , when ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_expr_one ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_expr_one ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_expr_empty ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_elts ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_elts_elt ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def tuple_elt ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def deco_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def decorators ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def decorators_single ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def decorator ( p ) : <EOL> return p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fun_expr ( p ) : <EOL> fun_name , fun_args = p [ <NUM_LIT:1> ] <EOL> return [ Symbol ( '<STR_LIT>' ) , fun_name , fun_args , p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fun_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) ] + p [ <NUM_LIT:6> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branches ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branches_branch ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def pattern ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fun_header ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:0> ] ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fun_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def args ( p ) : <EOL> return p [ <NUM_LIT:1> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def args_one ( p ) : <EOL> return [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def args_empty ( p ) : <EOL> return [ ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def args ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def args_one ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_arg_elts ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_arg_elts_elt ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_arg_elt ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> def _create_underscore_args ( exps ) : <EOL> max_num = _compute_underscore_max_num ( exps ) <EOL> if max_num == <NUM_LIT:1> : <EOL> return [ Symbol ( '<STR_LIT>' ) ] <EOL> else : <EOL> return [ Symbol ( '<STR_LIT:$>' + str ( n ) ) for n in range ( <NUM_LIT:1> , max_num + <NUM_LIT:1> ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def block_expr ( p ) : <EOL> block = p [ <NUM_LIT:1> ] <EOL> return [ Symbol ( '<STR_LIT>' ) , _create_underscore_args ( block ) , block ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def doc_string ( p ) : <EOL> pass <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return [ ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args_elts ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args_elts ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args_elt ( p ) : <EOL> return [ token_to_keyword ( p [ <NUM_LIT:0> ] ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args_elt_short ( p ) : <EOL> return [ token_to_keyword ( p [ <NUM_LIT:1> ] ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args_elt ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def trailing_closure_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def trailing_closure_expr ( p ) : <EOL> return [ [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:1> ] ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def trailing_closure_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:1> ] + [ p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_args ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def app_nc_arg ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def left_app_expr ( p ) : <EOL> expr , _ , left_app_fun_expr , app_args = p <EOL> return [ left_app_fun_expr , expr ] + app_args <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def left_app_fun_expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dict_expr_empty ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dict_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fields_one ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fields ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_fields_one ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_fields ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_field ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def field ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def field ( p ) : <EOL> s = token_to_symbol ( p [ <NUM_LIT:1> ] ) <EOL> return [ s . name , s ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def key ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] + p [ <NUM_LIT:5> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branches ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branches_branch ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:4> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case_branch ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def pattern ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def pattern_num ( p ) : <EOL> num_repr = p [ <NUM_LIT:0> ] . getstr ( ) <EOL> try : <EOL> return int ( num_repr ) <EOL> except ValueError as _ : <EOL> return float ( num_repr ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def pattern_string ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def pattern_bool ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dict_pattern_empty ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def dict_pattern ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fields_one ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def fields ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_fields_one ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_fields ( p ) : <EOL> return p [ <NUM_LIT:0> ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def list_field ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def field ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def field ( p ) : <EOL> s = token_to_symbol ( p [ <NUM_LIT:1> ] ) <EOL> return [ s . name , s ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def key ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def id_pattern ( p ) : <EOL> return token_to_symbol ( p [ <NUM_LIT:0> ] ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def id_pattern ( p ) : <EOL> return Symbol ( '<STR_LIT:&>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] + p [ <NUM_LIT:1> ] + [ p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern_one ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern_empty ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern_elts ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern_elts_elt ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_pattern_elt ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_type_pattern ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:2> ] + [ p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def sequence_type_pattern_one ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def and_pattern ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def or_pattern ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def type_pattern ( p ) : <EOL> return [ Symbol ( '<STR_LIT:type>' ) , token_to_symbol ( p [ <NUM_LIT:0> ] ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def quote_pattern ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def case ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , [ Symbol ( '<STR_LIT>' ) , [ Symbol ( '<STR_LIT>' ) ] ] ] + p [ <NUM_LIT:4> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def vector_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def vector_type ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , [ ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , token_to_symbol ( p [ <NUM_LIT:3> ] ) , [ ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , token_to_symbol ( p [ <NUM_LIT:6> ] ) , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , [ ] ] + p [ <NUM_LIT:5> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , token_to_symbol ( p [ <NUM_LIT:3> ] ) , [ ] ] + p [ <NUM_LIT:7> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:3> ] ] + p [ <NUM_LIT:8> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) , token_to_symbol ( p [ <NUM_LIT:6> ] ) , p [ <NUM_LIT:3> ] ] + p [ <NUM_LIT:10> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_body ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_body ( p ) : <EOL> return p [ <NUM_LIT:0> ] + [ p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def data_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT:data>' ) , token_to_symbol ( p [ <NUM_LIT:1> ] ) ] + p [ <NUM_LIT:5> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ p [ <NUM_LIT:0> ] ] + p [ <NUM_LIT:1> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def record_expr ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:0> ] ) ] + p [ <NUM_LIT:2> ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:0> ] ) , p [ <NUM_LIT:1> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ token_to_symbol ( p [ <NUM_LIT:1> ] ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:3> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> left , _ , right = p <EOL> input_sym = get_temp_name ( ) <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , [ Symbol ( '<STR_LIT>' ) , <EOL> [ Symbol ( '<STR_LIT>' ) , [ input_sym ] , p [ <NUM_LIT:2> ] + [ input_sym ] ] ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> left , _ , right = p <EOL> input_sym = get_temp_name ( ) <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , [ Symbol ( '<STR_LIT>' ) , <EOL> [ Symbol ( '<STR_LIT>' ) , [ input_sym ] , <EOL> [ p [ <NUM_LIT:2> ] [ <NUM_LIT:0> ] , input_sym ] + p [ <NUM_LIT:2> ] [ ( <NUM_LIT:1> if len ( p [ <NUM_LIT:2> ] ) > <NUM_LIT:1> else len ( p [ <NUM_LIT:2> ] ) ) : ] ] ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:0> ] , p [ <NUM_LIT:2> ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return [ Symbol ( '<STR_LIT>' ) , <EOL> [ Symbol ( '<STR_LIT>' ) , <EOL> [ Symbol ( '<STR_LIT>' ) , [ Symbol ( '<STR_LIT>' ) ] , <EOL> [ Symbol ( '<STR_LIT>' ) , Symbol ( '<STR_LIT>' ) , p [ <NUM_LIT:2> ] ] ] , <EOL> p [ <NUM_LIT:0> ] ] ] <EOL> @ pg . production ( '<STR_LIT>' ) <EOL> def binop_expr ( p ) : <EOL> return p [ <NUM_LIT:0> ] </s>
