ParseTree 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Makefile +3 -2
- data/lib/parse_tree.rb +5 -5
- data/test/something.rb +9 -0
- data/test/test_parse_tree.rb +8 -0
- metadata +2 -2
data/History.txt
CHANGED
data/Makefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
RUBY?=ruby
|
2
|
+
RUBY_DEBUG?=
|
2
3
|
RUBY_FLAGS?=-w -Ilib -Ibin
|
3
4
|
RUBY_LIB?=$(shell $(RUBY) -rrbconfig -e 'include Config; print CONFIG["sitelibdir"]')
|
4
5
|
PREFIX?=/usr/local
|
5
6
|
|
6
7
|
all test: FORCE
|
7
|
-
GEM_SKIP=ParseTree $(RUBY) $(RUBY_FLAGS) test/test_all.rb
|
8
|
+
GEM_SKIP=ParseTree $(RUBY) $(RUBY_DEBUG) $(RUBY_FLAGS) test/test_all.rb
|
8
9
|
|
9
10
|
# we only install test_sexp_processor.rb to help make ruby_to_c's
|
10
11
|
# subclass tests work.
|
@@ -32,7 +33,7 @@ clean:
|
|
32
33
|
-rm -fr diff diff.txt *.gem doc $$HOME/.ruby_inline
|
33
34
|
|
34
35
|
demo:
|
35
|
-
echo 1+1 | $(RUBY) $(RUBY_FLAGS) ./bin/parse_tree_show -f
|
36
|
+
echo 1+1 | GEM_SKIP=ParseTree $(RUBY) $(RUBY_FLAGS) ./bin/parse_tree_show -f
|
36
37
|
|
37
38
|
gem:
|
38
39
|
gem ParseTree.gemspec
|
data/lib/parse_tree.rb
CHANGED
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
class ParseTree
|
30
30
|
|
31
|
-
VERSION = '1.3.
|
31
|
+
VERSION = '1.3.4'
|
32
32
|
|
33
33
|
##
|
34
34
|
# Initializes a ParseTree instance. Includes newline nodes if
|
@@ -63,10 +63,9 @@ class ParseTree
|
|
63
63
|
klassname = klassname.to_sym
|
64
64
|
|
65
65
|
code = if Class === klass then
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
[:class, klassname, superclass]
|
66
|
+
sc = klass.superclass
|
67
|
+
sc_name = ((sc.nil? or sc.name.empty?) ? "nil" : sc.name).intern
|
68
|
+
[:class, klassname, sc_name]
|
70
69
|
else
|
71
70
|
[:module, klassname]
|
72
71
|
end
|
@@ -315,6 +314,7 @@ again_no_block:
|
|
315
314
|
case NODE_UNTIL:
|
316
315
|
add_to_parse_tree(current, node->nd_cond, newlines, locals);
|
317
316
|
add_to_parse_tree(current, node->nd_body, newlines, locals);
|
317
|
+
rb_ary_push(current, node->nd_3rd == 0 ? Qfalse : Qtrue);
|
318
318
|
break;
|
319
319
|
|
320
320
|
case NODE_BLOCK_PASS:
|
data/test/something.rb
CHANGED
data/test/test_parse_tree.rb
CHANGED
@@ -291,6 +291,14 @@ class TestParseTree < Test::Unit::TestCase
|
|
291
291
|
:type=,
|
292
292
|
[:array, [:call, [:vcall, :other], :type]]]]]]
|
293
293
|
|
294
|
+
@@whiles = [:defn,
|
295
|
+
:whiles,
|
296
|
+
[:scope,
|
297
|
+
[:block,
|
298
|
+
[:args],
|
299
|
+
[:while, [:false], [:fcall, :puts, [:array, [:str, "false"]]], true],
|
300
|
+
[:while, [:false], [:fcall, :puts, [:array, [:str, "true"]]], false]]]]
|
301
|
+
|
294
302
|
@@__all = [:class, :Something, :Object]
|
295
303
|
|
296
304
|
def setup
|
metadata
CHANGED