kanayago 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.rubocop.yml +12 -0
 - data/.ruby-version +1 -0
 - data/README.md +20 -29
 - data/Rakefile +24 -120
 - data/ext/kanayago/extconf.rb +14 -0
 - data/ext/kanayago/kanayago.c +554 -235
 - data/ext/kanayago/kanayago.h +5 -0
 - data/ext/kanayago/literal_node.c +343 -0
 - data/ext/kanayago/literal_node.h +30 -0
 - data/ext/kanayago/pattern_node.c +78 -0
 - data/ext/kanayago/pattern_node.h +13 -0
 - data/ext/kanayago/scope_node.c +34 -0
 - data/ext/kanayago/scope_node.h +8 -0
 - data/ext/kanayago/statement_node.c +795 -0
 - data/ext/kanayago/statement_node.h +66 -0
 - data/ext/kanayago/string_node.c +192 -0
 - data/ext/kanayago/string_node.h +19 -0
 - data/ext/kanayago/variable_node.c +72 -0
 - data/ext/kanayago/variable_node.h +12 -0
 - data/lib/kanayago/literal_node.rb +87 -0
 - data/lib/kanayago/pattern_node.rb +19 -0
 - data/lib/kanayago/statement_node.rb +222 -0
 - data/lib/kanayago/string_node.rb +43 -0
 - data/lib/kanayago/variable_node.rb +23 -0
 - data/lib/kanayago/version.rb +1 -1
 - data/lib/kanayago.rb +22 -0
 - data/patch/3.4/copy_target.rb +78 -0
 - data/patch/3.4/kanayago.patch +162 -0
 - data/patch/head/copy_target.rb +84 -0
 - data/patch/head/kanayago.patch +162 -0
 - data/sample/minitest_generator.rb +266 -0
 - data/sample/test_generator.rb +272 -0
 - data/script/setup_parser.rb +136 -0
 - data/typeprof.conf.json +9 -0
 - metadata +30 -64
 - data/ext/kanayago/ccan/check_type/check_type.h +0 -63
 - data/ext/kanayago/ccan/container_of/container_of.h +0 -142
 - data/ext/kanayago/ccan/list/list.h +0 -791
 - data/ext/kanayago/ccan/str/str.h +0 -17
 - data/ext/kanayago/constant.h +0 -53
 - data/ext/kanayago/id.h +0 -347
 - data/ext/kanayago/id_table.h +0 -39
 - data/ext/kanayago/internal/array.h +0 -151
 - data/ext/kanayago/internal/basic_operators.h +0 -64
 - data/ext/kanayago/internal/bignum.h +0 -244
 - data/ext/kanayago/internal/bits.h +0 -568
 - data/ext/kanayago/internal/compile.h +0 -34
 - data/ext/kanayago/internal/compilers.h +0 -107
 - data/ext/kanayago/internal/complex.h +0 -29
 - data/ext/kanayago/internal/encoding.h +0 -36
 - data/ext/kanayago/internal/error.h +0 -218
 - data/ext/kanayago/internal/fixnum.h +0 -184
 - data/ext/kanayago/internal/gc.h +0 -322
 - data/ext/kanayago/internal/hash.h +0 -191
 - data/ext/kanayago/internal/imemo.h +0 -261
 - data/ext/kanayago/internal/io.h +0 -140
 - data/ext/kanayago/internal/numeric.h +0 -274
 - data/ext/kanayago/internal/parse.h +0 -117
 - data/ext/kanayago/internal/rational.h +0 -71
 - data/ext/kanayago/internal/re.h +0 -28
 - data/ext/kanayago/internal/ruby_parser.h +0 -125
 - data/ext/kanayago/internal/sanitizers.h +0 -297
 - data/ext/kanayago/internal/serial.h +0 -23
 - data/ext/kanayago/internal/static_assert.h +0 -16
 - data/ext/kanayago/internal/string.h +0 -186
 - data/ext/kanayago/internal/symbol.h +0 -45
 - data/ext/kanayago/internal/thread.h +0 -79
 - data/ext/kanayago/internal/variable.h +0 -72
 - data/ext/kanayago/internal/vm.h +0 -137
 - data/ext/kanayago/internal/warnings.h +0 -16
 - data/ext/kanayago/internal.h +0 -108
 - data/ext/kanayago/lex.c +0 -302
 - data/ext/kanayago/method.h +0 -255
 - data/ext/kanayago/node.c +0 -440
 - data/ext/kanayago/node.h +0 -111
 - data/ext/kanayago/node_name.inc +0 -224
 - data/ext/kanayago/parse.c +0 -26931
 - data/ext/kanayago/parse.h +0 -244
 - data/ext/kanayago/parse.tmp.y +0 -16145
 - data/ext/kanayago/parser_bits.h +0 -564
 - data/ext/kanayago/parser_node.h +0 -32
 - data/ext/kanayago/parser_st.c +0 -164
 - data/ext/kanayago/parser_st.h +0 -162
 - data/ext/kanayago/parser_value.h +0 -106
 - data/ext/kanayago/probes.h +0 -4
 - data/ext/kanayago/ruby_assert.h +0 -14
 - data/ext/kanayago/ruby_atomic.h +0 -23
 - data/ext/kanayago/ruby_parser.c +0 -1165
 - data/ext/kanayago/rubyparser.h +0 -1391
 - data/ext/kanayago/shape.h +0 -234
 - data/ext/kanayago/st.c +0 -2339
 - data/ext/kanayago/symbol.h +0 -123
 - data/ext/kanayago/thread_pthread.h +0 -168
 - data/ext/kanayago/universal_parser.c +0 -230
 - data/ext/kanayago/vm_core.h +0 -2215
 - data/ext/kanayago/vm_opts.h +0 -67
 
| 
         @@ -0,0 +1,66 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef KANAYAGO_STATEMENT_NODE_H
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define KANAYAGO_STATEMENT_NODE_H
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #include "internal/ruby_parser.h"
         
     | 
| 
      
 5 
     | 
    
         
            +
            #include "kanayago.h"
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            VALUE if_statement_node_new(const NODE *);
         
     | 
| 
      
 8 
     | 
    
         
            +
            VALUE unless_statement_node_new(const NODE *);
         
     | 
| 
      
 9 
     | 
    
         
            +
            VALUE or_node_new(const NODE *);
         
     | 
| 
      
 10 
     | 
    
         
            +
            VALUE and_node_new(const NODE *);
         
     | 
| 
      
 11 
     | 
    
         
            +
            VALUE while_node_new(const NODE *);
         
     | 
| 
      
 12 
     | 
    
         
            +
            VALUE until_node_new(const NODE *);
         
     | 
| 
      
 13 
     | 
    
         
            +
            VALUE for_node_new(const NODE *);
         
     | 
| 
      
 14 
     | 
    
         
            +
            VALUE alias_node_new(const NODE *);
         
     | 
| 
      
 15 
     | 
    
         
            +
            VALUE valias_node_new(const NODE *);
         
     | 
| 
      
 16 
     | 
    
         
            +
            VALUE undef_node_new(const NODE *);
         
     | 
| 
      
 17 
     | 
    
         
            +
            VALUE return_node_new(const NODE *);
         
     | 
| 
      
 18 
     | 
    
         
            +
            VALUE global_assignment_node_new(const NODE *);
         
     | 
| 
      
 19 
     | 
    
         
            +
            VALUE class_variable_assignment_node_new(const NODE *);
         
     | 
| 
      
 20 
     | 
    
         
            +
            VALUE instance_assignment_node_new(const NODE *);
         
     | 
| 
      
 21 
     | 
    
         
            +
            VALUE local_assignment_node_new(const NODE *);
         
     | 
| 
      
 22 
     | 
    
         
            +
            VALUE singleton_definition_node_new(const NODE *);
         
     | 
| 
      
 23 
     | 
    
         
            +
            VALUE singleton_class_node_new(const NODE *);
         
     | 
| 
      
 24 
     | 
    
         
            +
            VALUE attribute_assignment_node_new(const NODE *);
         
     | 
| 
      
 25 
     | 
    
         
            +
            VALUE safe_call_node_new(const NODE *);
         
     | 
| 
      
 26 
     | 
    
         
            +
            VALUE super_node_new(const NODE *);
         
     | 
| 
      
 27 
     | 
    
         
            +
            VALUE zero_super_node_new(const NODE *);
         
     | 
| 
      
 28 
     | 
    
         
            +
            VALUE case_node_new(const NODE *);
         
     | 
| 
      
 29 
     | 
    
         
            +
            VALUE case2_node_new(const NODE *);
         
     | 
| 
      
 30 
     | 
    
         
            +
            VALUE case3_node_new(const NODE *);
         
     | 
| 
      
 31 
     | 
    
         
            +
            VALUE when_node_new(const NODE *);
         
     | 
| 
      
 32 
     | 
    
         
            +
            VALUE retry_node_new(const NODE *);
         
     | 
| 
      
 33 
     | 
    
         
            +
            VALUE redo_node_new(const NODE *);
         
     | 
| 
      
 34 
     | 
    
         
            +
            VALUE break_node_new(const NODE *);
         
     | 
| 
      
 35 
     | 
    
         
            +
            VALUE next_node_new(const NODE *);
         
     | 
| 
      
 36 
     | 
    
         
            +
            VALUE defined_node_new(const NODE *);
         
     | 
| 
      
 37 
     | 
    
         
            +
            VALUE iter_node_new(const NODE *);
         
     | 
| 
      
 38 
     | 
    
         
            +
            VALUE ensure_node_new(const NODE *);
         
     | 
| 
      
 39 
     | 
    
         
            +
            VALUE rescue_node_new(const NODE *);
         
     | 
| 
      
 40 
     | 
    
         
            +
            VALUE resbody_node_new(const NODE *);
         
     | 
| 
      
 41 
     | 
    
         
            +
            VALUE operator_assignment1_node_new(const NODE *);
         
     | 
| 
      
 42 
     | 
    
         
            +
            VALUE operator_assignment2_node_new(const NODE *);
         
     | 
| 
      
 43 
     | 
    
         
            +
            VALUE operator_assignment_and_node_new(const NODE *);
         
     | 
| 
      
 44 
     | 
    
         
            +
            VALUE operator_assignment_or_node_new(const NODE *);
         
     | 
| 
      
 45 
     | 
    
         
            +
            VALUE operator_constant_declaration_node_new(const NODE *);
         
     | 
| 
      
 46 
     | 
    
         
            +
            VALUE yield_node_new(const NODE *);
         
     | 
| 
      
 47 
     | 
    
         
            +
            VALUE lambda_node_new(const NODE *);
         
     | 
| 
      
 48 
     | 
    
         
            +
            VALUE splat_node_new(const NODE *);
         
     | 
| 
      
 49 
     | 
    
         
            +
            VALUE block_pass_node_new(const NODE *);
         
     | 
| 
      
 50 
     | 
    
         
            +
            VALUE args_aux_node_new(const NODE *);
         
     | 
| 
      
 51 
     | 
    
         
            +
            VALUE opt_arg_node_new(const NODE *);
         
     | 
| 
      
 52 
     | 
    
         
            +
            VALUE kw_arg_node_new(const NODE *);
         
     | 
| 
      
 53 
     | 
    
         
            +
            VALUE post_arg_node_new(const NODE *);
         
     | 
| 
      
 54 
     | 
    
         
            +
            VALUE args_cat_node_new(const NODE *);
         
     | 
| 
      
 55 
     | 
    
         
            +
            VALUE args_push_node_new(const NODE *);
         
     | 
| 
      
 56 
     | 
    
         
            +
            VALUE for_masgn_node_new(const NODE *);
         
     | 
| 
      
 57 
     | 
    
         
            +
            VALUE masgn_node_new(const NODE *);
         
     | 
| 
      
 58 
     | 
    
         
            +
            VALUE dasgn_node_new(const NODE *);
         
     | 
| 
      
 59 
     | 
    
         
            +
            VALUE once_node_new(const NODE *);
         
     | 
| 
      
 60 
     | 
    
         
            +
            VALUE errinfo_node_new(const NODE *);
         
     | 
| 
      
 61 
     | 
    
         
            +
            VALUE postexe_node_new(const NODE *);
         
     | 
| 
      
 62 
     | 
    
         
            +
            VALUE error_node_new(const NODE *);
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            void Init_StatementNode(VALUE);
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
            #endif
         
     | 
| 
         @@ -0,0 +1,192 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #include "string_node.h"
         
     | 
| 
      
 2 
     | 
    
         
            +
            #include "internal/ruby_parser.h"
         
     | 
| 
      
 3 
     | 
    
         
            +
            #include "internal/encoding.h"
         
     | 
| 
      
 4 
     | 
    
         
            +
            #include "kanayago.h"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            VALUE rb_cDynamicStringNode;
         
     | 
| 
      
 7 
     | 
    
         
            +
            VALUE rb_cDynamicSymbolNode;
         
     | 
| 
      
 8 
     | 
    
         
            +
            VALUE rb_cEmbeddedExpressionStringNode;
         
     | 
| 
      
 9 
     | 
    
         
            +
            VALUE rb_cExecuteStringNode;
         
     | 
| 
      
 10 
     | 
    
         
            +
            VALUE rb_cDynamicExecuteStringNode;
         
     | 
| 
      
 11 
     | 
    
         
            +
            VALUE rb_cRegexpNode;
         
     | 
| 
      
 12 
     | 
    
         
            +
            VALUE rb_cDynamicRegexpNode;
         
     | 
| 
      
 13 
     | 
    
         
            +
            VALUE rb_cMatchNode;
         
     | 
| 
      
 14 
     | 
    
         
            +
            VALUE rb_cMatch2Node;
         
     | 
| 
      
 15 
     | 
    
         
            +
            VALUE rb_cMatch3Node;
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 18 
     | 
    
         
            +
            dynamic_string_node_new(const NODE *node)
         
     | 
| 
      
 19 
     | 
    
         
            +
            {
         
     | 
| 
      
 20 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cDynamicStringNode);
         
     | 
| 
      
 21 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_DSTR(node)->string;
         
     | 
| 
      
 22 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 23 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 24 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@string"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 27 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@next_nodes"), ast_to_node_instance((const NODE *)RNODE_DSTR(node)->nd_next));
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 30 
     | 
    
         
            +
            }
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 33 
     | 
    
         
            +
            dynamic_symbol_node_new(const NODE *node)
         
     | 
| 
      
 34 
     | 
    
         
            +
            {
         
     | 
| 
      
 35 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cDynamicSymbolNode);
         
     | 
| 
      
 36 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_DSYM(node)->string;
         
     | 
| 
      
 37 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 38 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 39 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@string"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 42 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@next_nodes"), ast_to_node_instance((const NODE *)RNODE_DSYM(node)->nd_next));
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 45 
     | 
    
         
            +
            }
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 48 
     | 
    
         
            +
            embedded_expression_string_node_new(const NODE *node)
         
     | 
| 
      
 49 
     | 
    
         
            +
            {
         
     | 
| 
      
 50 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cEmbeddedExpressionStringNode);
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@body"), ast_to_node_instance(RNODE_EVSTR(node)->nd_body));
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 55 
     | 
    
         
            +
            }
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 58 
     | 
    
         
            +
            execute_string_node_new(const NODE *node)
         
     | 
| 
      
 59 
     | 
    
         
            +
            {
         
     | 
| 
      
 60 
     | 
    
         
            +
                VALUE result = rb_class_new_instance(0, 0, rb_cExecuteStringNode);
         
     | 
| 
      
 61 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_XSTR(node)->string;
         
     | 
| 
      
 62 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 63 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 64 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 65 
     | 
    
         
            +
                enum rb_parser_string_coderange_type coderange = str->coderange;
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@ptr"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 68 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@len"), LONG2FIX(len));
         
     | 
| 
      
 69 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@enc"), rb_enc_from_encoding(enc));
         
     | 
| 
      
 70 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@coderange"), INT2FIX(coderange));
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
                return result;
         
     | 
| 
      
 73 
     | 
    
         
            +
            }
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 76 
     | 
    
         
            +
            dynamic_execute_string_node_new(const NODE *node)
         
     | 
| 
      
 77 
     | 
    
         
            +
            {
         
     | 
| 
      
 78 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cDynamicExecuteStringNode);
         
     | 
| 
      
 79 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_DXSTR(node)->string;
         
     | 
| 
      
 80 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 81 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 82 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@string"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 85 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@next_nodes"), ast_to_node_instance((const NODE *)RNODE_DXSTR(node)->nd_next));
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 88 
     | 
    
         
            +
            }
         
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 91 
     | 
    
         
            +
            regexp_node_new(const NODE *node)
         
     | 
| 
      
 92 
     | 
    
         
            +
            {
         
     | 
| 
      
 93 
     | 
    
         
            +
                VALUE result = rb_class_new_instance(0, 0, rb_cRegexpNode);
         
     | 
| 
      
 94 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_REGX(node)->string;
         
     | 
| 
      
 95 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 96 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 97 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 98 
     | 
    
         
            +
                enum rb_parser_string_coderange_type coderange = str->coderange;
         
     | 
| 
      
 99 
     | 
    
         
            +
                int options = RNODE_REGX(node)->options;
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@ptr"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 102 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@len"), LONG2FIX(len));
         
     | 
| 
      
 103 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@enc"), rb_enc_from_encoding(enc));
         
     | 
| 
      
 104 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@coderange"), INT2FIX(coderange));
         
     | 
| 
      
 105 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@options"), INT2FIX(options));
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                return result;
         
     | 
| 
      
 108 
     | 
    
         
            +
            }
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 111 
     | 
    
         
            +
            dynamic_regexp_node_new(const NODE *node)
         
     | 
| 
      
 112 
     | 
    
         
            +
            {
         
     | 
| 
      
 113 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cDynamicRegexpNode);
         
     | 
| 
      
 114 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_DREGX(node)->string;
         
     | 
| 
      
 115 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 116 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 117 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 118 
     | 
    
         
            +
                long options = RNODE_DREGX(node)->as.nd_cflag;
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@string"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 121 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@next_nodes"), ast_to_node_instance((const NODE *)RNODE_DREGX(node)->nd_next));
         
     | 
| 
      
 122 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@options"), LONG2FIX(options));
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
      
 124 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 125 
     | 
    
         
            +
            }
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 128 
     | 
    
         
            +
            match_node_new(const NODE *node)
         
     | 
| 
      
 129 
     | 
    
         
            +
            {
         
     | 
| 
      
 130 
     | 
    
         
            +
                VALUE result = rb_class_new_instance(0, 0, rb_cMatchNode);
         
     | 
| 
      
 131 
     | 
    
         
            +
                rb_parser_string_t *str = RNODE_MATCH(node)->string;
         
     | 
| 
      
 132 
     | 
    
         
            +
                rb_encoding *enc = str->enc;
         
     | 
| 
      
 133 
     | 
    
         
            +
                char *ptr = str->ptr;
         
     | 
| 
      
 134 
     | 
    
         
            +
                long len = str->len;
         
     | 
| 
      
 135 
     | 
    
         
            +
                enum rb_parser_string_coderange_type coderange = str->coderange;
         
     | 
| 
      
 136 
     | 
    
         
            +
                int options = RNODE_MATCH(node)->options;
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@ptr"), rb_enc_str_new(ptr, len, enc));
         
     | 
| 
      
 139 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@len"), LONG2FIX(len));
         
     | 
| 
      
 140 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@enc"), rb_enc_from_encoding(enc));
         
     | 
| 
      
 141 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@coderange"), INT2FIX(coderange));
         
     | 
| 
      
 142 
     | 
    
         
            +
                rb_ivar_set(result, rb_intern("@options"), INT2FIX(options));
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                return result;
         
     | 
| 
      
 145 
     | 
    
         
            +
            }
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 148 
     | 
    
         
            +
            match2_node_new(const NODE *node)
         
     | 
| 
      
 149 
     | 
    
         
            +
            {
         
     | 
| 
      
 150 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cMatch2Node);
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@recv"), ast_to_node_instance(RNODE_MATCH2(node)->nd_recv));
         
     | 
| 
      
 153 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@value"), ast_to_node_instance(RNODE_MATCH2(node)->nd_value));
         
     | 
| 
      
 154 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@args"), ast_to_node_instance(RNODE_MATCH2(node)->nd_args));
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 157 
     | 
    
         
            +
            }
         
     | 
| 
      
 158 
     | 
    
         
            +
             
     | 
| 
      
 159 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 160 
     | 
    
         
            +
            match3_node_new(const NODE *node)
         
     | 
| 
      
 161 
     | 
    
         
            +
            {
         
     | 
| 
      
 162 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cMatch3Node);
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@recv"), ast_to_node_instance(RNODE_MATCH3(node)->nd_recv));
         
     | 
| 
      
 165 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@value"), ast_to_node_instance(RNODE_MATCH3(node)->nd_value));
         
     | 
| 
      
 166 
     | 
    
         
            +
             
     | 
| 
      
 167 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 168 
     | 
    
         
            +
            }
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
            void
         
     | 
| 
      
 171 
     | 
    
         
            +
            Init_StringNode(VALUE module)
         
     | 
| 
      
 172 
     | 
    
         
            +
            {
         
     | 
| 
      
 173 
     | 
    
         
            +
                rb_cDynamicStringNode = rb_define_class_under(module, "DynamicStringNode", rb_cObject);
         
     | 
| 
      
 174 
     | 
    
         
            +
             
     | 
| 
      
 175 
     | 
    
         
            +
                rb_cDynamicSymbolNode = rb_define_class_under(module, "DynamicSymbolNode", rb_cObject);
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
                rb_cEmbeddedExpressionStringNode = rb_define_class_under(module, "EmbeddedExpressionStringNode", rb_cObject);
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
                rb_cExecuteStringNode = rb_define_class_under(module, "ExecuteStringNode", rb_cObject);
         
     | 
| 
      
 180 
     | 
    
         
            +
             
     | 
| 
      
 181 
     | 
    
         
            +
                rb_cDynamicExecuteStringNode = rb_define_class_under(module, "DynamicExecuteStringNode", rb_cObject);
         
     | 
| 
      
 182 
     | 
    
         
            +
             
     | 
| 
      
 183 
     | 
    
         
            +
                rb_cRegexpNode = rb_define_class_under(module, "RegexpNode", rb_cObject);
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
                rb_cDynamicRegexpNode = rb_define_class_under(module, "DynamicRegexpNode", rb_cObject);
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
      
 187 
     | 
    
         
            +
                rb_cMatchNode = rb_define_class_under(module, "MatchNode", rb_cObject);
         
     | 
| 
      
 188 
     | 
    
         
            +
             
     | 
| 
      
 189 
     | 
    
         
            +
                rb_cMatch2Node = rb_define_class_under(module, "Match2Node", rb_cObject);
         
     | 
| 
      
 190 
     | 
    
         
            +
             
     | 
| 
      
 191 
     | 
    
         
            +
                rb_cMatch3Node = rb_define_class_under(module, "Match3Node", rb_cObject);
         
     | 
| 
      
 192 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef KANAYAGO_STRING_NODE_H
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define KANAYAGO_STRING_NODE_H
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #include "kanayago.h"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            VALUE dynamic_string_node_new(const NODE*);
         
     | 
| 
      
 7 
     | 
    
         
            +
            VALUE dynamic_symbol_node_new(const NODE*);
         
     | 
| 
      
 8 
     | 
    
         
            +
            VALUE embedded_expression_string_node_new(const NODE *);
         
     | 
| 
      
 9 
     | 
    
         
            +
            VALUE execute_string_node_new(const NODE *);
         
     | 
| 
      
 10 
     | 
    
         
            +
            VALUE dynamic_execute_string_node_new(const NODE *);
         
     | 
| 
      
 11 
     | 
    
         
            +
            VALUE regexp_node_new(const NODE *);
         
     | 
| 
      
 12 
     | 
    
         
            +
            VALUE dynamic_regexp_node_new(const NODE *);
         
     | 
| 
      
 13 
     | 
    
         
            +
            VALUE match_node_new(const NODE *);
         
     | 
| 
      
 14 
     | 
    
         
            +
            VALUE match2_node_new(const NODE *);
         
     | 
| 
      
 15 
     | 
    
         
            +
            VALUE match3_node_new(const NODE *);
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            void Init_StringNode(VALUE);
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            #endif
         
     | 
| 
         @@ -0,0 +1,72 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #include "internal/ruby_parser.h"
         
     | 
| 
      
 2 
     | 
    
         
            +
            #include "kanayago.h"
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            VALUE rb_cLocalVariableNode;
         
     | 
| 
      
 5 
     | 
    
         
            +
            VALUE rb_cDynamicVariableNode;
         
     | 
| 
      
 6 
     | 
    
         
            +
            VALUE rb_cInstanceVariableNode;
         
     | 
| 
      
 7 
     | 
    
         
            +
            VALUE rb_cClassVariableNode;
         
     | 
| 
      
 8 
     | 
    
         
            +
            VALUE rb_cGlobalVariableNode;
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 11 
     | 
    
         
            +
            local_variable_node_new(const NODE *node)
         
     | 
| 
      
 12 
     | 
    
         
            +
            {
         
     | 
| 
      
 13 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cLocalVariableNode);
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@vid"), ID2SYM(RNODE_LVAR(node)->nd_vid));
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 18 
     | 
    
         
            +
            }
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 21 
     | 
    
         
            +
            dynamic_variable_node_new(const NODE *node)
         
     | 
| 
      
 22 
     | 
    
         
            +
            {
         
     | 
| 
      
 23 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cDynamicVariableNode);
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@vid"), ID2SYM(RNODE_DVAR(node)->nd_vid));
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 28 
     | 
    
         
            +
            }
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 31 
     | 
    
         
            +
            instance_variable_node_new(const NODE *node)
         
     | 
| 
      
 32 
     | 
    
         
            +
            {
         
     | 
| 
      
 33 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cInstanceVariableNode);
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@vid"), ID2SYM(RNODE_IVAR(node)->nd_vid));
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 38 
     | 
    
         
            +
            }
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 41 
     | 
    
         
            +
            class_variable_node_new(const NODE *node)
         
     | 
| 
      
 42 
     | 
    
         
            +
            {
         
     | 
| 
      
 43 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cClassVariableNode);
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@vid"), ID2SYM(RNODE_IVAR(node)->nd_vid));
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 48 
     | 
    
         
            +
            }
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            VALUE
         
     | 
| 
      
 51 
     | 
    
         
            +
            global_variable_node_new(const NODE *node)
         
     | 
| 
      
 52 
     | 
    
         
            +
            {
         
     | 
| 
      
 53 
     | 
    
         
            +
                VALUE obj = rb_class_new_instance(0, 0, rb_cGlobalVariableNode);
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                rb_ivar_set(obj, rb_intern("@vid"), ID2SYM(RNODE_GVAR(node)->nd_vid));
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                return obj;
         
     | 
| 
      
 58 
     | 
    
         
            +
            }
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            void
         
     | 
| 
      
 61 
     | 
    
         
            +
            Init_VariableNode(VALUE module)
         
     | 
| 
      
 62 
     | 
    
         
            +
            {
         
     | 
| 
      
 63 
     | 
    
         
            +
                rb_cLocalVariableNode = rb_define_class_under(module, "LocalVariableNode", rb_cObject);
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                rb_cDynamicVariableNode = rb_define_class_under(module, "DynamicVariableNode", rb_cObject);
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
                rb_cInstanceVariableNode = rb_define_class_under(module, "InstanceVariableNode", rb_cObject);
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                rb_cClassVariableNode = rb_define_class_under(module, "ClassVariableNode", rb_cObject);
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                rb_cGlobalVariableNode = rb_define_class_under(module, "GlobalVariableNode", rb_cObject);
         
     | 
| 
      
 72 
     | 
    
         
            +
            }
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #ifndef KANAYAGO_VARIABLE_NODE_H
         
     | 
| 
      
 2 
     | 
    
         
            +
            #define KANAYAGO_VARIABLE_NODE_H
         
     | 
| 
      
 3 
     | 
    
         
            +
            #include "kanayago.h"
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            VALUE local_variable_node_new(const NODE *);
         
     | 
| 
      
 6 
     | 
    
         
            +
            VALUE dynamic_variable_node_new(const NODE *);
         
     | 
| 
      
 7 
     | 
    
         
            +
            VALUE instance_variable_node_new(const NODE *);
         
     | 
| 
      
 8 
     | 
    
         
            +
            VALUE class_variable_node_new(const NODE *);
         
     | 
| 
      
 9 
     | 
    
         
            +
            VALUE global_variable_node_new(const NODE *);
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            void Init_VariableNode(VALUE);
         
     | 
| 
      
 12 
     | 
    
         
            +
            #endif
         
     | 
| 
         @@ -0,0 +1,87 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Kanayago
         
     | 
| 
      
 4 
     | 
    
         
            +
              class IntegerNode
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_reader :val, :minus, :base
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              class FloatNode
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_reader :val, :minus
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              class RationalNode
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_reader :val, :minus, :base, :seen_point
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              class ImaginaryNode
         
     | 
| 
      
 17 
     | 
    
         
            +
                attr_reader :val, :minus, :base, :seen_point, :type
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              class StringNode
         
     | 
| 
      
 21 
     | 
    
         
            +
                attr_reader :ptr, :len, :enc, :coderange
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              class SymbolNode
         
     | 
| 
      
 25 
     | 
    
         
            +
                attr_reader :ptr, :len, :enc, :coderange
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              class ListNode
         
     | 
| 
      
 29 
     | 
    
         
            +
                attr_reader :len, :val
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              class ZeroListNode
         
     | 
| 
      
 33 
     | 
    
         
            +
                attr_reader :len, :val
         
     | 
| 
      
 34 
     | 
    
         
            +
              end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
              class FileNode
         
     | 
| 
      
 37 
     | 
    
         
            +
                attr_reader :ptr, :len, :enc, :coderange
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              class LineNode
         
     | 
| 
      
 41 
     | 
    
         
            +
                attr_reader :lineno
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
              class EncodingNode
         
     | 
| 
      
 45 
     | 
    
         
            +
                attr_reader :val
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              class NilNode
         
     | 
| 
      
 49 
     | 
    
         
            +
                attr_reader :val
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              class TrueNode
         
     | 
| 
      
 53 
     | 
    
         
            +
                attr_reader :val
         
     | 
| 
      
 54 
     | 
    
         
            +
              end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
              class FalseNode
         
     | 
| 
      
 57 
     | 
    
         
            +
                attr_reader :val
         
     | 
| 
      
 58 
     | 
    
         
            +
              end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
              class RangeNode
         
     | 
| 
      
 61 
     | 
    
         
            +
                attr_reader :beg, :end
         
     | 
| 
      
 62 
     | 
    
         
            +
              end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
              class ExclusiveRangeNode
         
     | 
| 
      
 65 
     | 
    
         
            +
                attr_reader :beg, :end
         
     | 
| 
      
 66 
     | 
    
         
            +
              end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
              class FlipFlopNode
         
     | 
| 
      
 69 
     | 
    
         
            +
                attr_reader :beg, :end
         
     | 
| 
      
 70 
     | 
    
         
            +
              end
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
              class ExclusiveFlipFlopNode
         
     | 
| 
      
 73 
     | 
    
         
            +
                attr_reader :beg, :end
         
     | 
| 
      
 74 
     | 
    
         
            +
              end
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
              class HashNode
         
     | 
| 
      
 77 
     | 
    
         
            +
                attr_reader :head, :brace
         
     | 
| 
      
 78 
     | 
    
         
            +
              end
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
              class NthRefNode
         
     | 
| 
      
 81 
     | 
    
         
            +
                attr_reader :nth
         
     | 
| 
      
 82 
     | 
    
         
            +
              end
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
              class BackRefNode
         
     | 
| 
      
 85 
     | 
    
         
            +
                attr_reader :nth
         
     | 
| 
      
 86 
     | 
    
         
            +
              end
         
     | 
| 
      
 87 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Kanayago
         
     | 
| 
      
 4 
     | 
    
         
            +
              class InNode
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_reader :head, :body, :next
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              class ArrayPatternNode
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_reader :pconst, :pre_args, :rest_arg, :post_args
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              class HashPatternNode
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_reader :pconst, :pkwargs, :pkwrestarg
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              class FindPatternNode
         
     | 
| 
      
 17 
     | 
    
         
            +
                attr_reader :pconst, :pre_rest_arg, :args, :post_rest_arg
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,222 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Kanayago
         
     | 
| 
      
 4 
     | 
    
         
            +
              class IfStatementNode
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_reader :cond, :body, :else
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              class UnlessStatementNode
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_reader :cond, :body, :else
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              class OrNode
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_reader :first, :second
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              class AndNode
         
     | 
| 
      
 17 
     | 
    
         
            +
                attr_reader :first, :second
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              class WhileNode
         
     | 
| 
      
 21 
     | 
    
         
            +
                attr_reader :state, :cond, :body
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              class UntilNode
         
     | 
| 
      
 25 
     | 
    
         
            +
                attr_reader :state, :cond, :body
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              class ForNode
         
     | 
| 
      
 29 
     | 
    
         
            +
                attr_reader :iter, :body
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              class AliasNode
         
     | 
| 
      
 33 
     | 
    
         
            +
                attr_reader :first, :second
         
     | 
| 
      
 34 
     | 
    
         
            +
              end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
              class ValiasNode
         
     | 
| 
      
 37 
     | 
    
         
            +
                attr_reader :alias, :original
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              class UndefNode
         
     | 
| 
      
 41 
     | 
    
         
            +
                attr_reader :undefs
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
              class ReturnNode
         
     | 
| 
      
 45 
     | 
    
         
            +
                attr_reader :statements
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              class GlobalAssignmentNode
         
     | 
| 
      
 49 
     | 
    
         
            +
                attr_reader :id, :value
         
     | 
| 
      
 50 
     | 
    
         
            +
              end
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              class ClassVariableAssignmentNode
         
     | 
| 
      
 53 
     | 
    
         
            +
                attr_reader :id, :value
         
     | 
| 
      
 54 
     | 
    
         
            +
              end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
              class InstanceAssignmentNode
         
     | 
| 
      
 57 
     | 
    
         
            +
                attr_reader :id, :value
         
     | 
| 
      
 58 
     | 
    
         
            +
              end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
              class LocalAssignmentNode
         
     | 
| 
      
 61 
     | 
    
         
            +
                attr_reader :id, :value
         
     | 
| 
      
 62 
     | 
    
         
            +
              end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
              class SingletonDefinitionNode
         
     | 
| 
      
 65 
     | 
    
         
            +
                attr_reader :recv, :mid, :defn
         
     | 
| 
      
 66 
     | 
    
         
            +
              end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
              class SingletonClassNode
         
     | 
| 
      
 69 
     | 
    
         
            +
                attr_reader :recv, :body
         
     | 
| 
      
 70 
     | 
    
         
            +
              end
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
              class AttributeAssignmentNode
         
     | 
| 
      
 73 
     | 
    
         
            +
                attr_reader :recv, :mid, :args
         
     | 
| 
      
 74 
     | 
    
         
            +
              end
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
              class SafeCallNode
         
     | 
| 
      
 77 
     | 
    
         
            +
                attr_reader :recv, :mid, :args
         
     | 
| 
      
 78 
     | 
    
         
            +
              end
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
              class SuperNode
         
     | 
| 
      
 81 
     | 
    
         
            +
                attr_reader :args
         
     | 
| 
      
 82 
     | 
    
         
            +
              end
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
              class ZeroSuperNode # rubocop:disable Lint/EmptyClass
         
     | 
| 
      
 85 
     | 
    
         
            +
              end
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
              class CaseNode
         
     | 
| 
      
 88 
     | 
    
         
            +
                attr_reader :head, :body
         
     | 
| 
      
 89 
     | 
    
         
            +
              end
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
              class Case2Node
         
     | 
| 
      
 92 
     | 
    
         
            +
                attr_reader :body
         
     | 
| 
      
 93 
     | 
    
         
            +
              end
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
              class Case3Node
         
     | 
| 
      
 96 
     | 
    
         
            +
                attr_reader :head, :body
         
     | 
| 
      
 97 
     | 
    
         
            +
              end
         
     | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
      
 99 
     | 
    
         
            +
              class WhenNode
         
     | 
| 
      
 100 
     | 
    
         
            +
                attr_reader :head, :body, :next
         
     | 
| 
      
 101 
     | 
    
         
            +
              end
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
              class RetryNode # rubocop:disable Lint/EmptyClass
         
     | 
| 
      
 104 
     | 
    
         
            +
              end
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
              class RedoNode # rubocop:disable Lint/EmptyClass
         
     | 
| 
      
 107 
     | 
    
         
            +
              end
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
              class BreakNode
         
     | 
| 
      
 110 
     | 
    
         
            +
                attr_reader :statements
         
     | 
| 
      
 111 
     | 
    
         
            +
              end
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
              class NextNode
         
     | 
| 
      
 114 
     | 
    
         
            +
                attr_reader :statements
         
     | 
| 
      
 115 
     | 
    
         
            +
              end
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
              class DefinedNode
         
     | 
| 
      
 118 
     | 
    
         
            +
                attr_reader :head
         
     | 
| 
      
 119 
     | 
    
         
            +
              end
         
     | 
| 
      
 120 
     | 
    
         
            +
             
     | 
| 
      
 121 
     | 
    
         
            +
              class IterNode
         
     | 
| 
      
 122 
     | 
    
         
            +
                attr_reader :body, :iter
         
     | 
| 
      
 123 
     | 
    
         
            +
              end
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
              class EnsureNode
         
     | 
| 
      
 126 
     | 
    
         
            +
                attr_reader :head, :ensr
         
     | 
| 
      
 127 
     | 
    
         
            +
              end
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
              class RescueNode
         
     | 
| 
      
 130 
     | 
    
         
            +
                attr_reader :head, :resq, :else
         
     | 
| 
      
 131 
     | 
    
         
            +
              end
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
              class RescueBodyNode
         
     | 
| 
      
 134 
     | 
    
         
            +
                attr_reader :args, :exc_var, :body, :next
         
     | 
| 
      
 135 
     | 
    
         
            +
              end
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
              class OperatorAssignment1Node
         
     | 
| 
      
 138 
     | 
    
         
            +
                attr_reader :recv, :mid, :index, :rvalue
         
     | 
| 
      
 139 
     | 
    
         
            +
              end
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
              class OperatorAssignment2Node
         
     | 
| 
      
 142 
     | 
    
         
            +
                attr_reader :recv, :value, :vid, :mid
         
     | 
| 
      
 143 
     | 
    
         
            +
              end
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
              class OperatorAssignmentAndNode
         
     | 
| 
      
 146 
     | 
    
         
            +
                attr_reader :head, :value
         
     | 
| 
      
 147 
     | 
    
         
            +
              end
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
              class OperatorAssignmentOrNode
         
     | 
| 
      
 150 
     | 
    
         
            +
                attr_reader :head, :value
         
     | 
| 
      
 151 
     | 
    
         
            +
              end
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
              class OperatorConstantDeclarationNode
         
     | 
| 
      
 154 
     | 
    
         
            +
                attr_reader :head, :value, :aid, :shareability
         
     | 
| 
      
 155 
     | 
    
         
            +
              end
         
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
              class YieldNode
         
     | 
| 
      
 158 
     | 
    
         
            +
                attr_reader :head
         
     | 
| 
      
 159 
     | 
    
         
            +
              end
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
              class LambdaNode
         
     | 
| 
      
 162 
     | 
    
         
            +
                attr_reader :body
         
     | 
| 
      
 163 
     | 
    
         
            +
              end
         
     | 
| 
      
 164 
     | 
    
         
            +
             
     | 
| 
      
 165 
     | 
    
         
            +
              class SplatNode
         
     | 
| 
      
 166 
     | 
    
         
            +
                attr_reader :head
         
     | 
| 
      
 167 
     | 
    
         
            +
              end
         
     | 
| 
      
 168 
     | 
    
         
            +
             
     | 
| 
      
 169 
     | 
    
         
            +
              class BlockPassNode
         
     | 
| 
      
 170 
     | 
    
         
            +
                attr_reader :head, :body, :forwarding
         
     | 
| 
      
 171 
     | 
    
         
            +
              end
         
     | 
| 
      
 172 
     | 
    
         
            +
             
     | 
| 
      
 173 
     | 
    
         
            +
              class ArgsAuxNode
         
     | 
| 
      
 174 
     | 
    
         
            +
                attr_reader :pid, :plen, :next
         
     | 
| 
      
 175 
     | 
    
         
            +
              end
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
              class OptArgNode
         
     | 
| 
      
 178 
     | 
    
         
            +
                attr_reader :body, :next
         
     | 
| 
      
 179 
     | 
    
         
            +
              end
         
     | 
| 
      
 180 
     | 
    
         
            +
             
     | 
| 
      
 181 
     | 
    
         
            +
              class KwArgNode
         
     | 
| 
      
 182 
     | 
    
         
            +
                attr_reader :body, :next
         
     | 
| 
      
 183 
     | 
    
         
            +
              end
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
              class PostArgNode
         
     | 
| 
      
 186 
     | 
    
         
            +
                attr_reader :first, :second
         
     | 
| 
      
 187 
     | 
    
         
            +
              end
         
     | 
| 
      
 188 
     | 
    
         
            +
             
     | 
| 
      
 189 
     | 
    
         
            +
              class ArgsCatNode
         
     | 
| 
      
 190 
     | 
    
         
            +
                attr_reader :head, :body
         
     | 
| 
      
 191 
     | 
    
         
            +
              end
         
     | 
| 
      
 192 
     | 
    
         
            +
             
     | 
| 
      
 193 
     | 
    
         
            +
              class ArgsPushNode
         
     | 
| 
      
 194 
     | 
    
         
            +
                attr_reader :head, :body
         
     | 
| 
      
 195 
     | 
    
         
            +
              end
         
     | 
| 
      
 196 
     | 
    
         
            +
             
     | 
| 
      
 197 
     | 
    
         
            +
              class ForMasgnNode
         
     | 
| 
      
 198 
     | 
    
         
            +
                attr_reader :var
         
     | 
| 
      
 199 
     | 
    
         
            +
              end
         
     | 
| 
      
 200 
     | 
    
         
            +
             
     | 
| 
      
 201 
     | 
    
         
            +
              class MasgnNode
         
     | 
| 
      
 202 
     | 
    
         
            +
                attr_reader :head, :value, :args
         
     | 
| 
      
 203 
     | 
    
         
            +
              end
         
     | 
| 
      
 204 
     | 
    
         
            +
             
     | 
| 
      
 205 
     | 
    
         
            +
              class DasgnNode
         
     | 
| 
      
 206 
     | 
    
         
            +
                attr_reader :vid, :value
         
     | 
| 
      
 207 
     | 
    
         
            +
              end
         
     | 
| 
      
 208 
     | 
    
         
            +
             
     | 
| 
      
 209 
     | 
    
         
            +
              class OnceNode
         
     | 
| 
      
 210 
     | 
    
         
            +
                attr_reader :body
         
     | 
| 
      
 211 
     | 
    
         
            +
              end
         
     | 
| 
      
 212 
     | 
    
         
            +
             
     | 
| 
      
 213 
     | 
    
         
            +
              class ErrinfoNode # rubocop:disable Lint/EmptyClass
         
     | 
| 
      
 214 
     | 
    
         
            +
              end
         
     | 
| 
      
 215 
     | 
    
         
            +
             
     | 
| 
      
 216 
     | 
    
         
            +
              class PostexeNode
         
     | 
| 
      
 217 
     | 
    
         
            +
                attr_reader :body
         
     | 
| 
      
 218 
     | 
    
         
            +
              end
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
      
 220 
     | 
    
         
            +
              class ErrorNode # rubocop:disable Lint/EmptyClass
         
     | 
| 
      
 221 
     | 
    
         
            +
              end
         
     | 
| 
      
 222 
     | 
    
         
            +
            end
         
     |