looksee 3.0.0-universal-java-1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +66 -0
- data/LICENSE +22 -0
- data/README.markdown +175 -0
- data/Rakefile +13 -0
- data/ext/extconf.rb +19 -0
- data/ext/mri/1.9.2/debug.h +36 -0
- data/ext/mri/1.9.2/id.h +170 -0
- data/ext/mri/1.9.2/method.h +103 -0
- data/ext/mri/1.9.2/node.h +483 -0
- data/ext/mri/1.9.2/thread_pthread.h +27 -0
- data/ext/mri/1.9.2/vm_core.h +707 -0
- data/ext/mri/1.9.2/vm_opts.h +51 -0
- data/ext/mri/1.9.3/atomic.h +56 -0
- data/ext/mri/1.9.3/debug.h +41 -0
- data/ext/mri/1.9.3/id.h +175 -0
- data/ext/mri/1.9.3/internal.h +227 -0
- data/ext/mri/1.9.3/internal_falcon.h +248 -0
- data/ext/mri/1.9.3/method.h +105 -0
- data/ext/mri/1.9.3/node.h +503 -0
- data/ext/mri/1.9.3/thread_pthread.h +51 -0
- data/ext/mri/1.9.3/vm_core.h +755 -0
- data/ext/mri/1.9.3/vm_opts.h +51 -0
- data/ext/mri/2.0.0/internal.h +378 -0
- data/ext/mri/2.0.0/method.h +138 -0
- data/ext/mri/2.1.0/internal.h +889 -0
- data/ext/mri/2.1.0/method.h +142 -0
- data/ext/mri/2.2.0/internal.h +1182 -0
- data/ext/mri/2.2.0/method.h +141 -0
- data/ext/mri/env-1.8.h +27 -0
- data/ext/mri/eval_c-1.8.h +27 -0
- data/ext/mri/mri.c +309 -0
- data/ext/mri/node-1.9.h +35 -0
- data/ext/rbx/rbx.c +13 -0
- data/lib/looksee.rb +2 -0
- data/lib/looksee/JRuby.jar +0 -0
- data/lib/looksee/adapter.rb +8 -0
- data/lib/looksee/adapter/base.rb +105 -0
- data/lib/looksee/adapter/rubinius.rb +84 -0
- data/lib/looksee/clean.rb +169 -0
- data/lib/looksee/columnizer.rb +73 -0
- data/lib/looksee/core_ext.rb +48 -0
- data/lib/looksee/editor.rb +64 -0
- data/lib/looksee/help.rb +54 -0
- data/lib/looksee/inspector.rb +70 -0
- data/lib/looksee/lookup_path.rb +95 -0
- data/lib/looksee/rbx.bundle +0 -0
- data/lib/looksee/version.rb +11 -0
- data/spec/looksee/adapter_spec.rb +588 -0
- data/spec/looksee/clean_spec.rb +41 -0
- data/spec/looksee/columnizer_spec.rb +52 -0
- data/spec/looksee/core_ext_spec.rb +17 -0
- data/spec/looksee/editor_spec.rb +107 -0
- data/spec/looksee/inspector_spec.rb +179 -0
- data/spec/looksee/lookup_path_spec.rb +87 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/support/core_ext.rb +25 -0
- data/spec/support/temporary_classes.rb +78 -0
- data/spec/support/test_adapter.rb +83 -0
- metadata +116 -0
@@ -0,0 +1,248 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
internal.h -
|
4
|
+
|
5
|
+
$Author$
|
6
|
+
created at: Tue May 17 11:42:20 JST 2011
|
7
|
+
|
8
|
+
Copyright (C) 2011 Yukihiro Matsumoto
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#ifndef RUBY_INTERNAL_H
|
13
|
+
#define RUBY_INTERNAL_H 1
|
14
|
+
|
15
|
+
#if defined(__cplusplus)
|
16
|
+
extern "C" {
|
17
|
+
#if 0
|
18
|
+
} /* satisfy cc-mode */
|
19
|
+
#endif
|
20
|
+
#endif
|
21
|
+
|
22
|
+
struct rb_deprecated_classext_struct {
|
23
|
+
char conflict[sizeof(VALUE) * 3];
|
24
|
+
};
|
25
|
+
|
26
|
+
struct rb_classext_struct {
|
27
|
+
sa_table m_tbl;
|
28
|
+
sa_table iv_tbl;
|
29
|
+
sa_table const_tbl;
|
30
|
+
sa_table iv_index_tbl;
|
31
|
+
};
|
32
|
+
|
33
|
+
struct rb_class_cache_struct {
|
34
|
+
VALUE method_cache_version;
|
35
|
+
sa_table m_cache_tbl;
|
36
|
+
};
|
37
|
+
|
38
|
+
#undef RCLASS_SUPER
|
39
|
+
#define RCLASS_EXT(c) (RCLASS(c)->ptr)
|
40
|
+
#define RCLASS_SUPER(c) (RCLASS(c)->super)
|
41
|
+
#define RCLASS_IV_TBL(c) (&RCLASS_EXT(c)->iv_tbl)
|
42
|
+
#define RCLASS_CONST_TBL(c) (&RCLASS_EXT(c)->const_tbl)
|
43
|
+
#define RCLASS_M_TBL(c) (&RCLASS_EXT(c)->m_tbl)
|
44
|
+
#define RCLASS_IV_INDEX_TBL(c) (&RCLASS_EXT(c)->iv_index_tbl)
|
45
|
+
|
46
|
+
struct vtm; /* defined by timev.h */
|
47
|
+
|
48
|
+
/* array.c */
|
49
|
+
VALUE rb_ary_last(int, VALUE *, VALUE);
|
50
|
+
|
51
|
+
/* bignum.c */
|
52
|
+
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
53
|
+
VALUE rb_big_uminus(VALUE x);
|
54
|
+
|
55
|
+
/* class.c */
|
56
|
+
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
|
57
|
+
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
|
58
|
+
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
|
59
|
+
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
|
60
|
+
int rb_obj_basic_to_s_p(VALUE);
|
61
|
+
void Init_class_hierarchy(void);
|
62
|
+
|
63
|
+
/* compile.c */
|
64
|
+
int rb_dvar_defined(ID);
|
65
|
+
int rb_local_defined(ID);
|
66
|
+
int rb_parse_in_eval(void);
|
67
|
+
int rb_parse_in_main(void);
|
68
|
+
VALUE rb_insns_name_array(void);
|
69
|
+
|
70
|
+
/* cont.c */
|
71
|
+
VALUE rb_obj_is_fiber(VALUE);
|
72
|
+
void rb_fiber_reset_root_local_storage(VALUE);
|
73
|
+
|
74
|
+
/* debug.c */
|
75
|
+
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
|
76
|
+
|
77
|
+
/* dmyext.c */
|
78
|
+
void Init_ext(void);
|
79
|
+
|
80
|
+
/* encoding.c */
|
81
|
+
ID rb_id_encoding(void);
|
82
|
+
|
83
|
+
/* encoding.c */
|
84
|
+
void rb_gc_mark_encodings(void);
|
85
|
+
|
86
|
+
/* error.c */
|
87
|
+
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
|
88
|
+
VALUE rb_check_backtrace(VALUE);
|
89
|
+
NORETURN(void rb_async_bug_errno(const char *,int));
|
90
|
+
|
91
|
+
/* eval_error.c */
|
92
|
+
void ruby_error_print(void);
|
93
|
+
VALUE rb_get_backtrace(VALUE info);
|
94
|
+
|
95
|
+
/* eval_jump.c */
|
96
|
+
void rb_call_end_proc(VALUE data);
|
97
|
+
|
98
|
+
/* file.c */
|
99
|
+
VALUE rb_home_dir(const char *user, VALUE result);
|
100
|
+
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
101
|
+
VALUE rb_file_expand_path_fast(VALUE, VALUE);
|
102
|
+
VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
|
103
|
+
VALUE rb_get_path_check_to_string(VALUE, int);
|
104
|
+
VALUE rb_get_path_check_convert(VALUE, VALUE, int);
|
105
|
+
void Init_File(void);
|
106
|
+
|
107
|
+
#ifdef _WIN32
|
108
|
+
/* file.c, win32/file.c */
|
109
|
+
void rb_w32_init_file(void);
|
110
|
+
#endif
|
111
|
+
|
112
|
+
/* gc.c */
|
113
|
+
void Init_heap(void);
|
114
|
+
|
115
|
+
/* inits.c */
|
116
|
+
void rb_call_inits(void);
|
117
|
+
|
118
|
+
/* io.c */
|
119
|
+
const char *ruby_get_inplace_mode(void);
|
120
|
+
void ruby_set_inplace_mode(const char *);
|
121
|
+
ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
|
122
|
+
void rb_stdio_set_default_encoding(void);
|
123
|
+
|
124
|
+
/* iseq.c */
|
125
|
+
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
|
126
|
+
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
127
|
+
|
128
|
+
/* load.c */
|
129
|
+
VALUE rb_get_load_path(void);
|
130
|
+
VALUE rb_get_expanded_load_path(void);
|
131
|
+
|
132
|
+
/* math.c */
|
133
|
+
VALUE rb_math_atan2(VALUE, VALUE);
|
134
|
+
VALUE rb_math_cos(VALUE);
|
135
|
+
VALUE rb_math_cosh(VALUE);
|
136
|
+
VALUE rb_math_exp(VALUE);
|
137
|
+
VALUE rb_math_hypot(VALUE, VALUE);
|
138
|
+
VALUE rb_math_log(int argc, VALUE *argv);
|
139
|
+
VALUE rb_math_sin(VALUE);
|
140
|
+
VALUE rb_math_sinh(VALUE);
|
141
|
+
VALUE rb_math_sqrt(VALUE);
|
142
|
+
|
143
|
+
/* newline.c */
|
144
|
+
void Init_newline(void);
|
145
|
+
|
146
|
+
/* numeric.c */
|
147
|
+
int rb_num_to_uint(VALUE val, unsigned int *ret);
|
148
|
+
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
|
149
|
+
double ruby_float_mod(double x, double y);
|
150
|
+
|
151
|
+
/* object.c */
|
152
|
+
VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
|
153
|
+
|
154
|
+
/* parse.y */
|
155
|
+
VALUE rb_parser_get_yydebug(VALUE);
|
156
|
+
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
157
|
+
|
158
|
+
/* proc.c */
|
159
|
+
VALUE rb_proc_location(VALUE self);
|
160
|
+
|
161
|
+
/* rational.c */
|
162
|
+
VALUE rb_lcm(VALUE x, VALUE y);
|
163
|
+
VALUE rb_rational_reciprocal(VALUE x);
|
164
|
+
|
165
|
+
/* re.c */
|
166
|
+
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
167
|
+
VALUE rb_reg_check_preprocess(VALUE);
|
168
|
+
|
169
|
+
/* signal.c */
|
170
|
+
int rb_get_next_signal(void);
|
171
|
+
|
172
|
+
/* strftime.c */
|
173
|
+
size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
|
174
|
+
|
175
|
+
/* string.c */
|
176
|
+
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
|
177
|
+
|
178
|
+
/* struct.c */
|
179
|
+
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
|
180
|
+
|
181
|
+
/* time.c */
|
182
|
+
struct timeval rb_time_timeval(VALUE);
|
183
|
+
|
184
|
+
/* thread.c */
|
185
|
+
VALUE rb_obj_is_mutex(VALUE obj);
|
186
|
+
VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
|
187
|
+
void rb_thread_execute_interrupts(VALUE th);
|
188
|
+
void rb_clear_trace_func(void);
|
189
|
+
VALUE rb_thread_backtrace(VALUE thval);
|
190
|
+
VALUE rb_get_coverages(void);
|
191
|
+
|
192
|
+
/* thread_pthread.c, thread_win32.c */
|
193
|
+
void Init_native_thread(void);
|
194
|
+
|
195
|
+
/* vm.c */
|
196
|
+
VALUE rb_obj_is_thread(VALUE obj);
|
197
|
+
void rb_vm_mark(void *ptr);
|
198
|
+
void Init_BareVM(void);
|
199
|
+
VALUE rb_vm_top_self(void);
|
200
|
+
void rb_thread_recycle_stack_release(VALUE *);
|
201
|
+
void rb_vm_change_state(void);
|
202
|
+
void rb_vm_inc_const_missing_count(void);
|
203
|
+
void rb_thread_mark(void *th);
|
204
|
+
const void **rb_vm_get_insns_address_table(void);
|
205
|
+
|
206
|
+
/* vm_dump.c */
|
207
|
+
void rb_vm_bugreport(void);
|
208
|
+
|
209
|
+
/* vm_eval.c */
|
210
|
+
void Init_vm_eval(void);
|
211
|
+
VALUE rb_current_realfilepath(void);
|
212
|
+
|
213
|
+
/* vm_method.c */
|
214
|
+
void Init_eval_method(void);
|
215
|
+
|
216
|
+
/* miniprelude.c, prelude.c */
|
217
|
+
void Init_prelude(void);
|
218
|
+
|
219
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
220
|
+
#pragma GCC visibility push(default)
|
221
|
+
#endif
|
222
|
+
const char *rb_objspace_data_type_name(VALUE obj);
|
223
|
+
|
224
|
+
/* Temporary. This API will be removed (renamed). */
|
225
|
+
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
|
226
|
+
|
227
|
+
/* experimental.
|
228
|
+
* These APIs can be changed on Ruby 1.9.4 or later.
|
229
|
+
* We will change these APIs (spac, name and so on) if there are something wrong.
|
230
|
+
* If you use these APIs, catch up future changes.
|
231
|
+
*/
|
232
|
+
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
|
233
|
+
VALUE rb_thread_call_without_gvl(
|
234
|
+
rb_blocking_function_t *func, void *data1,
|
235
|
+
rb_unblock_function_t *ubf, void *data2);
|
236
|
+
|
237
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
238
|
+
#pragma GCC visibility pop
|
239
|
+
#endif
|
240
|
+
|
241
|
+
#if defined(__cplusplus)
|
242
|
+
#if 0
|
243
|
+
{ /* satisfy cc-mode */
|
244
|
+
#endif
|
245
|
+
} /* extern "C" { */
|
246
|
+
#endif
|
247
|
+
|
248
|
+
#endif /* RUBY_INTERNAL_H */
|
@@ -0,0 +1,105 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
method.h -
|
4
|
+
|
5
|
+
$Author: yugui $
|
6
|
+
created at: Wed Jul 15 20:02:33 2009
|
7
|
+
|
8
|
+
Copyright (C) 2009 Koichi Sasada
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
#ifndef METHOD_H
|
12
|
+
#define METHOD_H
|
13
|
+
|
14
|
+
typedef enum {
|
15
|
+
NOEX_PUBLIC = 0x00,
|
16
|
+
NOEX_NOSUPER = 0x01,
|
17
|
+
NOEX_PRIVATE = 0x02,
|
18
|
+
NOEX_PROTECTED = 0x04,
|
19
|
+
NOEX_MASK = 0x06,
|
20
|
+
NOEX_BASIC = 0x08,
|
21
|
+
NOEX_UNDEF = NOEX_NOSUPER,
|
22
|
+
NOEX_MODFUNC = 0x12,
|
23
|
+
NOEX_SUPER = 0x20,
|
24
|
+
NOEX_VCALL = 0x40,
|
25
|
+
NOEX_RESPONDS = 0x80
|
26
|
+
} rb_method_flag_t;
|
27
|
+
|
28
|
+
#define NOEX_SAFE(n) ((int)((n) >> 8) & 0x0F)
|
29
|
+
#define NOEX_WITH(n, s) (((s) << 8) | (n) | (ruby_running ? 0 : NOEX_BASIC))
|
30
|
+
#define NOEX_WITH_SAFE(n) NOEX_WITH((n), rb_safe_level())
|
31
|
+
|
32
|
+
/* method data type */
|
33
|
+
|
34
|
+
typedef enum {
|
35
|
+
VM_METHOD_TYPE_ISEQ,
|
36
|
+
VM_METHOD_TYPE_CFUNC,
|
37
|
+
VM_METHOD_TYPE_ATTRSET,
|
38
|
+
VM_METHOD_TYPE_IVAR,
|
39
|
+
VM_METHOD_TYPE_BMETHOD,
|
40
|
+
VM_METHOD_TYPE_ZSUPER,
|
41
|
+
VM_METHOD_TYPE_UNDEF,
|
42
|
+
VM_METHOD_TYPE_NOTIMPLEMENTED,
|
43
|
+
VM_METHOD_TYPE_OPTIMIZED, /* Kernel#send, Proc#call, etc */
|
44
|
+
VM_METHOD_TYPE_MISSING /* wrapper for method_missing(id) */
|
45
|
+
} rb_method_type_t;
|
46
|
+
|
47
|
+
typedef struct rb_method_cfunc_struct {
|
48
|
+
VALUE (*func)(ANYARGS);
|
49
|
+
int argc;
|
50
|
+
} rb_method_cfunc_t;
|
51
|
+
|
52
|
+
typedef struct rb_method_attr_struct {
|
53
|
+
ID id;
|
54
|
+
VALUE location;
|
55
|
+
} rb_method_attr_t;
|
56
|
+
|
57
|
+
typedef struct rb_iseq_struct rb_iseq_t;
|
58
|
+
|
59
|
+
typedef struct rb_method_definition_struct {
|
60
|
+
rb_method_type_t type; /* method type */
|
61
|
+
ID original_id;
|
62
|
+
union {
|
63
|
+
rb_iseq_t *iseq; /* should be mark */
|
64
|
+
rb_method_cfunc_t cfunc;
|
65
|
+
rb_method_attr_t attr;
|
66
|
+
VALUE proc; /* should be mark */
|
67
|
+
enum method_optimized_type {
|
68
|
+
OPTIMIZED_METHOD_TYPE_SEND,
|
69
|
+
OPTIMIZED_METHOD_TYPE_CALL
|
70
|
+
} optimize_type;
|
71
|
+
} body;
|
72
|
+
int alias_count;
|
73
|
+
} rb_method_definition_t;
|
74
|
+
|
75
|
+
typedef struct rb_method_entry_struct {
|
76
|
+
rb_method_flag_t flag;
|
77
|
+
char mark;
|
78
|
+
rb_method_definition_t *def;
|
79
|
+
ID called_id;
|
80
|
+
VALUE klass; /* should be mark */
|
81
|
+
} rb_method_entry_t;
|
82
|
+
|
83
|
+
struct unlinked_method_entry_list_entry {
|
84
|
+
struct unlinked_method_entry_list_entry *next;
|
85
|
+
rb_method_entry_t *me;
|
86
|
+
};
|
87
|
+
|
88
|
+
#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
|
89
|
+
|
90
|
+
void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
|
91
|
+
rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
|
92
|
+
rb_method_entry_t *rb_method_entry(VALUE klass, ID id);
|
93
|
+
|
94
|
+
rb_method_entry_t *rb_method_entry_get_without_cache(VALUE klass, ID id);
|
95
|
+
rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex);
|
96
|
+
|
97
|
+
int rb_method_entry_arity(const rb_method_entry_t *me);
|
98
|
+
int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2);
|
99
|
+
|
100
|
+
void rb_mark_method_entry(const rb_method_entry_t *me);
|
101
|
+
void rb_free_method_entry(rb_method_entry_t *me);
|
102
|
+
void rb_sweep_method_entry(void *vm);
|
103
|
+
void rb_free_m_table(st_table *tbl);
|
104
|
+
|
105
|
+
#endif /* METHOD_H */
|
@@ -0,0 +1,503 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
node.h -
|
4
|
+
|
5
|
+
$Author: akr $
|
6
|
+
created at: Fri May 28 15:14:02 JST 1993
|
7
|
+
|
8
|
+
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#ifndef RUBY_NODE_H
|
13
|
+
#define RUBY_NODE_H 1
|
14
|
+
|
15
|
+
#if defined(__cplusplus)
|
16
|
+
extern "C" {
|
17
|
+
#if 0
|
18
|
+
} /* satisfy cc-mode */
|
19
|
+
#endif
|
20
|
+
#endif
|
21
|
+
|
22
|
+
enum node_type {
|
23
|
+
NODE_SCOPE,
|
24
|
+
#define NODE_SCOPE NODE_SCOPE
|
25
|
+
NODE_BLOCK,
|
26
|
+
#define NODE_BLOCK NODE_BLOCK
|
27
|
+
NODE_IF,
|
28
|
+
#define NODE_IF NODE_IF
|
29
|
+
NODE_CASE,
|
30
|
+
#define NODE_CASE NODE_CASE
|
31
|
+
NODE_WHEN,
|
32
|
+
#define NODE_WHEN NODE_WHEN
|
33
|
+
NODE_OPT_N,
|
34
|
+
#define NODE_OPT_N NODE_OPT_N
|
35
|
+
NODE_WHILE,
|
36
|
+
#define NODE_WHILE NODE_WHILE
|
37
|
+
NODE_UNTIL,
|
38
|
+
#define NODE_UNTIL NODE_UNTIL
|
39
|
+
NODE_ITER,
|
40
|
+
#define NODE_ITER NODE_ITER
|
41
|
+
NODE_FOR,
|
42
|
+
#define NODE_FOR NODE_FOR
|
43
|
+
NODE_BREAK,
|
44
|
+
#define NODE_BREAK NODE_BREAK
|
45
|
+
NODE_NEXT,
|
46
|
+
#define NODE_NEXT NODE_NEXT
|
47
|
+
NODE_REDO,
|
48
|
+
#define NODE_REDO NODE_REDO
|
49
|
+
NODE_RETRY,
|
50
|
+
#define NODE_RETRY NODE_RETRY
|
51
|
+
NODE_BEGIN,
|
52
|
+
#define NODE_BEGIN NODE_BEGIN
|
53
|
+
NODE_RESCUE,
|
54
|
+
#define NODE_RESCUE NODE_RESCUE
|
55
|
+
NODE_RESBODY,
|
56
|
+
#define NODE_RESBODY NODE_RESBODY
|
57
|
+
NODE_ENSURE,
|
58
|
+
#define NODE_ENSURE NODE_ENSURE
|
59
|
+
NODE_AND,
|
60
|
+
#define NODE_AND NODE_AND
|
61
|
+
NODE_OR,
|
62
|
+
#define NODE_OR NODE_OR
|
63
|
+
NODE_MASGN,
|
64
|
+
#define NODE_MASGN NODE_MASGN
|
65
|
+
NODE_LASGN,
|
66
|
+
#define NODE_LASGN NODE_LASGN
|
67
|
+
NODE_DASGN,
|
68
|
+
#define NODE_DASGN NODE_DASGN
|
69
|
+
NODE_DASGN_CURR,
|
70
|
+
#define NODE_DASGN_CURR NODE_DASGN_CURR
|
71
|
+
NODE_GASGN,
|
72
|
+
#define NODE_GASGN NODE_GASGN
|
73
|
+
NODE_IASGN,
|
74
|
+
#define NODE_IASGN NODE_IASGN
|
75
|
+
NODE_IASGN2,
|
76
|
+
#define NODE_IASGN2 NODE_IASGN2
|
77
|
+
NODE_CDECL,
|
78
|
+
#define NODE_CDECL NODE_CDECL
|
79
|
+
NODE_CVASGN,
|
80
|
+
#define NODE_CVASGN NODE_CVASGN
|
81
|
+
NODE_CVDECL,
|
82
|
+
#define NODE_CVDECL NODE_CVDECL
|
83
|
+
NODE_OP_ASGN1,
|
84
|
+
#define NODE_OP_ASGN1 NODE_OP_ASGN1
|
85
|
+
NODE_OP_ASGN2,
|
86
|
+
#define NODE_OP_ASGN2 NODE_OP_ASGN2
|
87
|
+
NODE_OP_ASGN_AND,
|
88
|
+
#define NODE_OP_ASGN_AND NODE_OP_ASGN_AND
|
89
|
+
NODE_OP_ASGN_OR,
|
90
|
+
#define NODE_OP_ASGN_OR NODE_OP_ASGN_OR
|
91
|
+
NODE_CALL,
|
92
|
+
#define NODE_CALL NODE_CALL
|
93
|
+
NODE_FCALL,
|
94
|
+
#define NODE_FCALL NODE_FCALL
|
95
|
+
NODE_VCALL,
|
96
|
+
#define NODE_VCALL NODE_VCALL
|
97
|
+
NODE_SUPER,
|
98
|
+
#define NODE_SUPER NODE_SUPER
|
99
|
+
NODE_ZSUPER,
|
100
|
+
#define NODE_ZSUPER NODE_ZSUPER
|
101
|
+
NODE_ARRAY,
|
102
|
+
#define NODE_ARRAY NODE_ARRAY
|
103
|
+
NODE_ZARRAY,
|
104
|
+
#define NODE_ZARRAY NODE_ZARRAY
|
105
|
+
NODE_VALUES,
|
106
|
+
#define NODE_VALUES NODE_VALUES
|
107
|
+
NODE_HASH,
|
108
|
+
#define NODE_HASH NODE_HASH
|
109
|
+
NODE_RETURN,
|
110
|
+
#define NODE_RETURN NODE_RETURN
|
111
|
+
NODE_YIELD,
|
112
|
+
#define NODE_YIELD NODE_YIELD
|
113
|
+
NODE_LVAR,
|
114
|
+
#define NODE_LVAR NODE_LVAR
|
115
|
+
NODE_DVAR,
|
116
|
+
#define NODE_DVAR NODE_DVAR
|
117
|
+
NODE_GVAR,
|
118
|
+
#define NODE_GVAR NODE_GVAR
|
119
|
+
NODE_IVAR,
|
120
|
+
#define NODE_IVAR NODE_IVAR
|
121
|
+
NODE_CONST,
|
122
|
+
#define NODE_CONST NODE_CONST
|
123
|
+
NODE_CVAR,
|
124
|
+
#define NODE_CVAR NODE_CVAR
|
125
|
+
NODE_NTH_REF,
|
126
|
+
#define NODE_NTH_REF NODE_NTH_REF
|
127
|
+
NODE_BACK_REF,
|
128
|
+
#define NODE_BACK_REF NODE_BACK_REF
|
129
|
+
NODE_MATCH,
|
130
|
+
#define NODE_MATCH NODE_MATCH
|
131
|
+
NODE_MATCH2,
|
132
|
+
#define NODE_MATCH2 NODE_MATCH2
|
133
|
+
NODE_MATCH3,
|
134
|
+
#define NODE_MATCH3 NODE_MATCH3
|
135
|
+
NODE_LIT,
|
136
|
+
#define NODE_LIT NODE_LIT
|
137
|
+
NODE_STR,
|
138
|
+
#define NODE_STR NODE_STR
|
139
|
+
NODE_DSTR,
|
140
|
+
#define NODE_DSTR NODE_DSTR
|
141
|
+
NODE_XSTR,
|
142
|
+
#define NODE_XSTR NODE_XSTR
|
143
|
+
NODE_DXSTR,
|
144
|
+
#define NODE_DXSTR NODE_DXSTR
|
145
|
+
NODE_EVSTR,
|
146
|
+
#define NODE_EVSTR NODE_EVSTR
|
147
|
+
NODE_DREGX,
|
148
|
+
#define NODE_DREGX NODE_DREGX
|
149
|
+
NODE_DREGX_ONCE,
|
150
|
+
#define NODE_DREGX_ONCE NODE_DREGX_ONCE
|
151
|
+
NODE_ARGS,
|
152
|
+
#define NODE_ARGS NODE_ARGS
|
153
|
+
NODE_ARGS_AUX,
|
154
|
+
#define NODE_ARGS_AUX NODE_ARGS_AUX
|
155
|
+
NODE_OPT_ARG,
|
156
|
+
#define NODE_OPT_ARG NODE_OPT_ARG
|
157
|
+
NODE_POSTARG,
|
158
|
+
#define NODE_POSTARG NODE_POSTARG
|
159
|
+
NODE_ARGSCAT,
|
160
|
+
#define NODE_ARGSCAT NODE_ARGSCAT
|
161
|
+
NODE_ARGSPUSH,
|
162
|
+
#define NODE_ARGSPUSH NODE_ARGSPUSH
|
163
|
+
NODE_SPLAT,
|
164
|
+
#define NODE_SPLAT NODE_SPLAT
|
165
|
+
NODE_TO_ARY,
|
166
|
+
#define NODE_TO_ARY NODE_TO_ARY
|
167
|
+
NODE_BLOCK_ARG,
|
168
|
+
#define NODE_BLOCK_ARG NODE_BLOCK_ARG
|
169
|
+
NODE_BLOCK_PASS,
|
170
|
+
#define NODE_BLOCK_PASS NODE_BLOCK_PASS
|
171
|
+
NODE_DEFN,
|
172
|
+
#define NODE_DEFN NODE_DEFN
|
173
|
+
NODE_DEFS,
|
174
|
+
#define NODE_DEFS NODE_DEFS
|
175
|
+
NODE_ALIAS,
|
176
|
+
#define NODE_ALIAS NODE_ALIAS
|
177
|
+
NODE_VALIAS,
|
178
|
+
#define NODE_VALIAS NODE_VALIAS
|
179
|
+
NODE_UNDEF,
|
180
|
+
#define NODE_UNDEF NODE_UNDEF
|
181
|
+
NODE_CLASS,
|
182
|
+
#define NODE_CLASS NODE_CLASS
|
183
|
+
NODE_MODULE,
|
184
|
+
#define NODE_MODULE NODE_MODULE
|
185
|
+
NODE_SCLASS,
|
186
|
+
#define NODE_SCLASS NODE_SCLASS
|
187
|
+
NODE_COLON2,
|
188
|
+
#define NODE_COLON2 NODE_COLON2
|
189
|
+
NODE_COLON3,
|
190
|
+
#define NODE_COLON3 NODE_COLON3
|
191
|
+
NODE_DOT2,
|
192
|
+
#define NODE_DOT2 NODE_DOT2
|
193
|
+
NODE_DOT3,
|
194
|
+
#define NODE_DOT3 NODE_DOT3
|
195
|
+
NODE_FLIP2,
|
196
|
+
#define NODE_FLIP2 NODE_FLIP2
|
197
|
+
NODE_FLIP3,
|
198
|
+
#define NODE_FLIP3 NODE_FLIP3
|
199
|
+
NODE_SELF,
|
200
|
+
#define NODE_SELF NODE_SELF
|
201
|
+
NODE_NIL,
|
202
|
+
#define NODE_NIL NODE_NIL
|
203
|
+
NODE_TRUE,
|
204
|
+
#define NODE_TRUE NODE_TRUE
|
205
|
+
NODE_FALSE,
|
206
|
+
#define NODE_FALSE NODE_FALSE
|
207
|
+
NODE_ERRINFO,
|
208
|
+
#define NODE_ERRINFO NODE_ERRINFO
|
209
|
+
NODE_DEFINED,
|
210
|
+
#define NODE_DEFINED NODE_DEFINED
|
211
|
+
NODE_POSTEXE,
|
212
|
+
#define NODE_POSTEXE NODE_POSTEXE
|
213
|
+
NODE_ALLOCA,
|
214
|
+
#define NODE_ALLOCA NODE_ALLOCA
|
215
|
+
NODE_BMETHOD,
|
216
|
+
#define NODE_BMETHOD NODE_BMETHOD
|
217
|
+
NODE_MEMO,
|
218
|
+
#define NODE_MEMO NODE_MEMO
|
219
|
+
NODE_IFUNC,
|
220
|
+
#define NODE_IFUNC NODE_IFUNC
|
221
|
+
NODE_DSYM,
|
222
|
+
#define NODE_DSYM NODE_DSYM
|
223
|
+
NODE_ATTRASGN,
|
224
|
+
#define NODE_ATTRASGN NODE_ATTRASGN
|
225
|
+
NODE_PRELUDE,
|
226
|
+
#define NODE_PRELUDE NODE_PRELUDE
|
227
|
+
NODE_LAMBDA,
|
228
|
+
#define NODE_LAMBDA NODE_LAMBDA
|
229
|
+
NODE_OPTBLOCK,
|
230
|
+
#define NODE_OPTBLOCK NODE_OPTBLOCK
|
231
|
+
NODE_LAST
|
232
|
+
#define NODE_LAST NODE_LAST
|
233
|
+
};
|
234
|
+
|
235
|
+
typedef struct RNode {
|
236
|
+
VALUE flags;
|
237
|
+
VALUE nd_reserved; /* ex nd_file */
|
238
|
+
union {
|
239
|
+
struct RNode *node;
|
240
|
+
ID id;
|
241
|
+
VALUE value;
|
242
|
+
VALUE (*cfunc)(ANYARGS);
|
243
|
+
ID *tbl;
|
244
|
+
} u1;
|
245
|
+
union {
|
246
|
+
struct RNode *node;
|
247
|
+
ID id;
|
248
|
+
long argc;
|
249
|
+
VALUE value;
|
250
|
+
} u2;
|
251
|
+
union {
|
252
|
+
struct RNode *node;
|
253
|
+
ID id;
|
254
|
+
long state;
|
255
|
+
struct rb_global_entry *entry;
|
256
|
+
long cnt;
|
257
|
+
VALUE value;
|
258
|
+
} u3;
|
259
|
+
} NODE;
|
260
|
+
|
261
|
+
#define RNODE(obj) (R_CAST(RNode)(obj))
|
262
|
+
|
263
|
+
/* 0..4:T_TYPES, 5:FL_MARK, 6:reserved, 7:NODE_FL_NEWLINE */
|
264
|
+
#define NODE_FL_NEWLINE (((VALUE)1)<<7)
|
265
|
+
#define NODE_FL_CREF_PUSHED_BY_EVAL NODE_FL_NEWLINE
|
266
|
+
|
267
|
+
#define NODE_TYPESHIFT 8
|
268
|
+
#define NODE_TYPEMASK (((VALUE)0x7f)<<NODE_TYPESHIFT)
|
269
|
+
|
270
|
+
#define nd_type(n) ((int) (((RNODE(n))->flags & NODE_TYPEMASK)>>NODE_TYPESHIFT))
|
271
|
+
#define nd_set_type(n,t) \
|
272
|
+
RNODE(n)->flags=((RNODE(n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<<NODE_TYPESHIFT)&NODE_TYPEMASK))
|
273
|
+
|
274
|
+
#define NODE_LSHIFT (NODE_TYPESHIFT+7)
|
275
|
+
#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
|
276
|
+
#define nd_line(n) (int)(RNODE(n)->flags>>NODE_LSHIFT)
|
277
|
+
#define nd_set_line(n,l) \
|
278
|
+
RNODE(n)->flags=((RNODE(n)->flags&~(-1<<NODE_LSHIFT))|(((l)&NODE_LMASK)<<NODE_LSHIFT))
|
279
|
+
|
280
|
+
#define nd_head u1.node
|
281
|
+
#define nd_alen u2.argc
|
282
|
+
#define nd_next u3.node
|
283
|
+
|
284
|
+
#define nd_cond u1.node
|
285
|
+
#define nd_body u2.node
|
286
|
+
#define nd_else u3.node
|
287
|
+
|
288
|
+
#define nd_orig u3.value
|
289
|
+
|
290
|
+
#define nd_resq u2.node
|
291
|
+
#define nd_ensr u3.node
|
292
|
+
|
293
|
+
#define nd_1st u1.node
|
294
|
+
#define nd_2nd u2.node
|
295
|
+
|
296
|
+
#define nd_stts u1.node
|
297
|
+
|
298
|
+
#define nd_entry u3.entry
|
299
|
+
#define nd_vid u1.id
|
300
|
+
#define nd_cflag u2.id
|
301
|
+
#define nd_cval u3.value
|
302
|
+
|
303
|
+
#define nd_oid u1.id
|
304
|
+
#define nd_cnt u3.cnt
|
305
|
+
#define nd_tbl u1.tbl
|
306
|
+
|
307
|
+
#define nd_var u1.node
|
308
|
+
#define nd_iter u3.node
|
309
|
+
|
310
|
+
#define nd_value u2.node
|
311
|
+
#define nd_aid u3.id
|
312
|
+
|
313
|
+
#define nd_lit u1.value
|
314
|
+
|
315
|
+
#define nd_frml u2.argc
|
316
|
+
#define nd_rest u1.id
|
317
|
+
#define nd_opt u1.node
|
318
|
+
#define nd_pid u1.id
|
319
|
+
#define nd_plen u2.argc
|
320
|
+
|
321
|
+
#define nd_recv u1.node
|
322
|
+
#define nd_mid u2.id
|
323
|
+
#define nd_args u3.node
|
324
|
+
|
325
|
+
#define nd_noex u3.id
|
326
|
+
#define nd_defn u3.node
|
327
|
+
|
328
|
+
#define nd_cfnc u1.cfunc
|
329
|
+
#define nd_argc u2.argc
|
330
|
+
|
331
|
+
#define nd_cpath u1.node
|
332
|
+
#define nd_super u3.node
|
333
|
+
|
334
|
+
#define nd_modl u1.id
|
335
|
+
#define nd_clss u1.value
|
336
|
+
|
337
|
+
#define nd_beg u1.node
|
338
|
+
#define nd_end u2.node
|
339
|
+
#define nd_state u3.state
|
340
|
+
#define nd_rval u2.value
|
341
|
+
|
342
|
+
#define nd_nth u2.argc
|
343
|
+
|
344
|
+
#define nd_tag u1.id
|
345
|
+
#define nd_tval u2.value
|
346
|
+
|
347
|
+
#define nd_visi u2.argc
|
348
|
+
|
349
|
+
#define NEW_NODE(t,a0,a1,a2) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2))
|
350
|
+
|
351
|
+
#define NEW_DEFN(i,a,d,p) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d))
|
352
|
+
#define NEW_DEFS(r,i,a,d) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d))
|
353
|
+
#define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
|
354
|
+
#define NEW_SCOPE(a,b) NEW_NODE(NODE_SCOPE,local_tbl(),b,a)
|
355
|
+
#define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
|
356
|
+
#define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
|
357
|
+
#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
|
358
|
+
#define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0)
|
359
|
+
#define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e)
|
360
|
+
#define NEW_OPT_N(b) NEW_NODE(NODE_OPT_N,0,b,0)
|
361
|
+
#define NEW_WHILE(c,b,n) NEW_NODE(NODE_WHILE,c,b,n)
|
362
|
+
#define NEW_UNTIL(c,b,n) NEW_NODE(NODE_UNTIL,c,b,n)
|
363
|
+
#define NEW_FOR(v,i,b) NEW_NODE(NODE_FOR,v,b,i)
|
364
|
+
#define NEW_ITER(a,b) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b),0)
|
365
|
+
#define NEW_LAMBDA(a) NEW_NODE(NODE_LAMBDA,a,0,0)
|
366
|
+
#define NEW_BREAK(s) NEW_NODE(NODE_BREAK,s,0,0)
|
367
|
+
#define NEW_NEXT(s) NEW_NODE(NODE_NEXT,s,0,0)
|
368
|
+
#define NEW_REDO() NEW_NODE(NODE_REDO,0,0,0)
|
369
|
+
#define NEW_RETRY() NEW_NODE(NODE_RETRY,0,0,0)
|
370
|
+
#define NEW_BEGIN(b) NEW_NODE(NODE_BEGIN,0,b,0)
|
371
|
+
#define NEW_RESCUE(b,res,e) NEW_NODE(NODE_RESCUE,b,res,e)
|
372
|
+
#define NEW_RESBODY(a,ex,n) NEW_NODE(NODE_RESBODY,n,ex,a)
|
373
|
+
#define NEW_ENSURE(b,en) NEW_NODE(NODE_ENSURE,b,0,en)
|
374
|
+
#define NEW_RETURN(s) NEW_NODE(NODE_RETURN,s,0,0)
|
375
|
+
#define NEW_YIELD(a,s) NEW_NODE(NODE_YIELD,a,0,s)
|
376
|
+
#define NEW_LIST(a) NEW_ARRAY(a)
|
377
|
+
#define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
|
378
|
+
#define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)
|
379
|
+
#define NEW_HASH(a) NEW_NODE(NODE_HASH,a,0,0)
|
380
|
+
#define NEW_MASGN(l,r) NEW_NODE(NODE_MASGN,l,0,r)
|
381
|
+
#define NEW_GASGN(v,val) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v))
|
382
|
+
#define NEW_LASGN(v,val) NEW_NODE(NODE_LASGN,v,val,0)
|
383
|
+
#define NEW_DASGN(v,val) NEW_NODE(NODE_DASGN,v,val,0)
|
384
|
+
#define NEW_DASGN_CURR(v,val) NEW_NODE(NODE_DASGN_CURR,v,val,0)
|
385
|
+
#define NEW_IASGN(v,val) NEW_NODE(NODE_IASGN,v,val,0)
|
386
|
+
#define NEW_IASGN2(v,val) NEW_NODE(NODE_IASGN2,v,val,0)
|
387
|
+
#define NEW_CDECL(v,val,path) NEW_NODE(NODE_CDECL,v,val,path)
|
388
|
+
#define NEW_CVASGN(v,val) NEW_NODE(NODE_CVASGN,v,val,0)
|
389
|
+
#define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
|
390
|
+
#define NEW_OP_ASGN1(p,id,a) NEW_NODE(NODE_OP_ASGN1,p,id,a)
|
391
|
+
#define NEW_OP_ASGN2(r,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
|
392
|
+
#define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
|
393
|
+
#define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
|
394
|
+
#define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
|
395
|
+
#define NEW_GVAR(v) NEW_NODE(NODE_GVAR,v,0,rb_global_entry(v))
|
396
|
+
#define NEW_LVAR(v) NEW_NODE(NODE_LVAR,v,0,0)
|
397
|
+
#define NEW_DVAR(v) NEW_NODE(NODE_DVAR,v,0,0)
|
398
|
+
#define NEW_IVAR(v) NEW_NODE(NODE_IVAR,v,0,0)
|
399
|
+
#define NEW_CONST(v) NEW_NODE(NODE_CONST,v,0,0)
|
400
|
+
#define NEW_CVAR(v) NEW_NODE(NODE_CVAR,v,0,0)
|
401
|
+
#define NEW_NTH_REF(n) NEW_NODE(NODE_NTH_REF,0,n,0)
|
402
|
+
#define NEW_BACK_REF(n) NEW_NODE(NODE_BACK_REF,0,n,0)
|
403
|
+
#define NEW_MATCH(c) NEW_NODE(NODE_MATCH,c,0,0)
|
404
|
+
#define NEW_MATCH2(n1,n2) NEW_NODE(NODE_MATCH2,n1,n2,0)
|
405
|
+
#define NEW_MATCH3(r,n2) NEW_NODE(NODE_MATCH3,r,n2,0)
|
406
|
+
#define NEW_LIT(l) NEW_NODE(NODE_LIT,l,0,0)
|
407
|
+
#define NEW_STR(s) NEW_NODE(NODE_STR,s,0,0)
|
408
|
+
#define NEW_DSTR(s) NEW_NODE(NODE_DSTR,s,1,0)
|
409
|
+
#define NEW_XSTR(s) NEW_NODE(NODE_XSTR,s,0,0)
|
410
|
+
#define NEW_DXSTR(s) NEW_NODE(NODE_DXSTR,s,0,0)
|
411
|
+
#define NEW_DSYM(s) NEW_NODE(NODE_DSYM,s,0,0)
|
412
|
+
#define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
|
413
|
+
#define NEW_CALL(r,m,a) NEW_NODE(NODE_CALL,r,m,a)
|
414
|
+
#define NEW_FCALL(m,a) NEW_NODE(NODE_FCALL,0,m,a)
|
415
|
+
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
|
416
|
+
#define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
|
417
|
+
#define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
|
418
|
+
#define NEW_ARGS(m,o) NEW_NODE(NODE_ARGS,o,m,0)
|
419
|
+
#define NEW_ARGS_AUX(r,b) NEW_NODE(NODE_ARGS_AUX,r,b,0)
|
420
|
+
#define NEW_OPT_ARG(i,v) NEW_NODE(NODE_OPT_ARG,i,v,0)
|
421
|
+
#define NEW_POSTARG(i,v) NEW_NODE(NODE_POSTARG,i,v,0)
|
422
|
+
#define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
|
423
|
+
#define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
|
424
|
+
#define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
|
425
|
+
#define NEW_TO_ARY(a) NEW_NODE(NODE_TO_ARY,a,0,0)
|
426
|
+
#define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
|
427
|
+
#define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)
|
428
|
+
#define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,n,o,0)
|
429
|
+
#define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,n,o,0)
|
430
|
+
#define NEW_UNDEF(i) NEW_NODE(NODE_UNDEF,0,i,0)
|
431
|
+
#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b),(s))
|
432
|
+
#define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b),0)
|
433
|
+
#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b),0)
|
434
|
+
#define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
|
435
|
+
#define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
|
436
|
+
#define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
|
437
|
+
#define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
|
438
|
+
#define NEW_SELF() NEW_NODE(NODE_SELF,0,0,0)
|
439
|
+
#define NEW_NIL() NEW_NODE(NODE_NIL,0,0,0)
|
440
|
+
#define NEW_TRUE() NEW_NODE(NODE_TRUE,0,0,0)
|
441
|
+
#define NEW_FALSE() NEW_NODE(NODE_FALSE,0,0,0)
|
442
|
+
#define NEW_ERRINFO() NEW_NODE(NODE_ERRINFO,0,0,0)
|
443
|
+
#define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0)
|
444
|
+
#define NEW_PREEXE(b) NEW_SCOPE(b)
|
445
|
+
#define NEW_POSTEXE(b) NEW_NODE(NODE_POSTEXE,0,b,0)
|
446
|
+
#define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
|
447
|
+
#define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
|
448
|
+
#define NEW_PRELUDE(p,b) NEW_NODE(NODE_PRELUDE,p,b,0)
|
449
|
+
#define NEW_OPTBLOCK(a) NEW_NODE(NODE_OPTBLOCK,a,0,0)
|
450
|
+
|
451
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
452
|
+
#pragma GCC visibility push(default)
|
453
|
+
#endif
|
454
|
+
|
455
|
+
VALUE rb_parser_new(void);
|
456
|
+
VALUE rb_parser_end_seen_p(VALUE);
|
457
|
+
VALUE rb_parser_encoding(VALUE);
|
458
|
+
VALUE rb_parser_get_yydebug(VALUE);
|
459
|
+
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
460
|
+
VALUE rb_parser_dump_tree(NODE *node, int comment);
|
461
|
+
NODE *rb_parser_append_print(VALUE, NODE *);
|
462
|
+
NODE *rb_parser_while_loop(VALUE, NODE *, int, int);
|
463
|
+
|
464
|
+
NODE *rb_parser_compile_cstr(volatile VALUE, const char*, const char*, int, int);
|
465
|
+
NODE *rb_parser_compile_string(volatile VALUE, const char*, VALUE, int);
|
466
|
+
NODE *rb_parser_compile_file(volatile VALUE, const char*, VALUE, int);
|
467
|
+
|
468
|
+
NODE *rb_compile_cstr(const char*, const char*, int, int);
|
469
|
+
NODE *rb_compile_string(const char*, VALUE, int);
|
470
|
+
NODE *rb_compile_file(const char*, VALUE, int);
|
471
|
+
|
472
|
+
NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
|
473
|
+
NODE *rb_node_newnode_longlife(enum node_type,VALUE,VALUE,VALUE);
|
474
|
+
|
475
|
+
struct rb_global_entry {
|
476
|
+
struct rb_global_variable *var;
|
477
|
+
ID id;
|
478
|
+
};
|
479
|
+
|
480
|
+
struct rb_global_entry *rb_global_entry(ID);
|
481
|
+
VALUE rb_gvar_get(struct rb_global_entry *);
|
482
|
+
VALUE rb_gvar_set(struct rb_global_entry *, VALUE);
|
483
|
+
VALUE rb_gvar_defined(struct rb_global_entry *);
|
484
|
+
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
485
|
+
|
486
|
+
struct parser_params;
|
487
|
+
void *rb_parser_malloc(struct parser_params *, size_t);
|
488
|
+
void *rb_parser_realloc(struct parser_params *, void *, size_t);
|
489
|
+
void *rb_parser_calloc(struct parser_params *, size_t, size_t);
|
490
|
+
void rb_parser_free(struct parser_params *, void *);
|
491
|
+
|
492
|
+
#if defined __GNUC__ && __GNUC__ >= 4
|
493
|
+
#pragma GCC visibility pop
|
494
|
+
#endif
|
495
|
+
|
496
|
+
#if defined(__cplusplus)
|
497
|
+
#if 0
|
498
|
+
{ /* satisfy cc-mode */
|
499
|
+
#endif
|
500
|
+
} /* extern "C" { */
|
501
|
+
#endif
|
502
|
+
|
503
|
+
#endif /* RUBY_NODE_H */
|