ParseTree 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ *** 1.3.4 / 2005-02-09
2
+
3
+ + 2 bug fixes
4
+ + bug:1459: Cleaned up and corrected superclass naming code.
5
+ + bug:1458: Fixed while to support post-conditional while/until nodes.
6
+
1
7
  *** 1.3.3 / 2005-02-01
2
8
 
3
9
  + 3 minor enhancement
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
@@ -28,7 +28,7 @@ end
28
28
 
29
29
  class ParseTree
30
30
 
31
- VERSION = '1.3.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
- superclass = klass.superclass.name
67
- superclass = "nil" if superclass.empty?
68
- superclass = superclass.to_sym
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:
@@ -179,6 +179,15 @@ class Something
179
179
  end
180
180
  end
181
181
 
182
+ def whiles
183
+ while false do
184
+ puts "false"
185
+ end
186
+ begin
187
+ puts "true"
188
+ end while false
189
+ end
190
+
182
191
  def self.bmethod_maker
183
192
  define_method(:bmethod_added) do |x|
184
193
  x + 1
@@ -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
@@ -3,8 +3,8 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: ParseTree
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.3.3
7
- date: 2005-02-01
6
+ version: 1.3.4
7
+ date: 2005-02-09
8
8
  summary: Extract and enumerate ruby parse trees.
9
9
  require_paths:
10
10
  - lib