ParseTree 2.1.0 → 2.1.1
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.
- data/History.txt +7 -1
- data/Rakefile +1 -1
- data/lib/parse_tree.rb +4 -8
- metadata +1 -1
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ Hoe.new("ParseTree", ParseTree::VERSION) do |p|
|
|
11
11
|
p.summary = "Extract and enumerate ruby parse trees."
|
12
12
|
p.summary = p.paragraphs_of("README.txt", 2).join("\n\n")
|
13
13
|
p.description = p.paragraphs_of("README.txt", 2..6, 8).join("\n\n")
|
14
|
-
p.changes = p.paragraphs_of("History.txt",
|
14
|
+
p.changes = p.paragraphs_of("History.txt", 0..2).join("\n\n")
|
15
15
|
p.clean_globs << File.expand_path("~/.ruby_inline")
|
16
16
|
p.extra_deps << ['RubyInline', '>= 3.6.0']
|
17
17
|
p.spec_extras[:require_paths] = proc { |paths| paths << 'test' }
|
data/lib/parse_tree.rb
CHANGED
@@ -41,7 +41,7 @@ end
|
|
41
41
|
|
42
42
|
class ParseTree
|
43
43
|
|
44
|
-
VERSION = '2.1.
|
44
|
+
VERSION = '2.1.1'
|
45
45
|
|
46
46
|
##
|
47
47
|
# Front end translation method.
|
@@ -334,7 +334,6 @@ class ParseTree
|
|
334
334
|
builder.prefix %Q@
|
335
335
|
void add_to_parse_tree(VALUE self, VALUE ary, NODE * n, ID * locals) {
|
336
336
|
NODE * volatile node = n;
|
337
|
-
VALUE old_ary = Qnil;
|
338
337
|
VALUE current;
|
339
338
|
VALUE node_name;
|
340
339
|
static VALUE node_names = Qnil;
|
@@ -364,9 +363,7 @@ again:
|
|
364
363
|
rb_ary_push(ary, current);
|
365
364
|
rb_ary_push(current, node_name);
|
366
365
|
|
367
|
-
|
368
|
-
|
369
|
-
switch (nd_type(node)) {
|
366
|
+
switch (nd_type(node)) {
|
370
367
|
|
371
368
|
case NODE_BLOCK:
|
372
369
|
{
|
@@ -438,7 +435,7 @@ again_no_block:
|
|
438
435
|
case NODE_WHEN:
|
439
436
|
when_level++;
|
440
437
|
if (!inside_case_args && case_level < when_level) { /* when without case, ie, no expr in case */
|
441
|
-
|
438
|
+
if (when_level > 0) when_level--;
|
442
439
|
rb_ary_pop(ary); /* reset what current is pointing at */
|
443
440
|
node = NEW_CASE(0, node);
|
444
441
|
goto again;
|
@@ -453,7 +450,7 @@ again_no_block:
|
|
453
450
|
rb_ary_push(current, Qnil);
|
454
451
|
}
|
455
452
|
|
456
|
-
|
453
|
+
if (when_level > 0) when_level--;
|
457
454
|
break;
|
458
455
|
|
459
456
|
case NODE_WHILE:
|
@@ -1011,7 +1008,6 @@ static VALUE parse_tree_for_str(VALUE source, VALUE filename, VALUE line) {
|
|
1011
1008
|
VALUE result = rb_ary_new();
|
1012
1009
|
NODE *node = NULL;
|
1013
1010
|
int critical;
|
1014
|
-
int newlines = RTEST(rb_iv_get(self, "@include_newlines"));
|
1015
1011
|
|
1016
1012
|
tmp = rb_check_string_type(filename);
|
1017
1013
|
if (NIL_P(tmp)) {
|