parsetree19 0.2

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/ChangeLog ADDED
@@ -0,0 +1,155 @@
1
+ 2010-12-25 rocky <rockyb@rubyforge.org>
2
+
3
+ * ChangeLog: Update README.md to include usage.
4
+
5
+ 2010-12-25 rocky <rockyb@rubyforge.org>
6
+
7
+ * ChangeLog, NEWS, Rakefile, ext/parse_tree.c: Make sure we use a
8
+ threadframe-patched Ruby 1.9.2
9
+
10
+ 2010-12-25 rocky <rockyb@rubyforge.org>
11
+
12
+ * ChangeLog, Rakefile: Need one more file...
13
+
14
+ 2010-12-25 rocky <rockyb@rubyforge.org>
15
+
16
+ * ChangeLog, NEWS, Rakefile: Administrivia for first release.
17
+
18
+ 2010-12-25 rocky <rockyb@rubyforge.org>
19
+
20
+ * Rakefile, ext/add_to_parse_tree.inc, ext/parse_tree.c,
21
+ test/unit/test_parse_tree_for_meth.rb: Finish Node parsing. Add
22
+ parse_tree_for_method and parse_tree_for_iseq.
23
+
24
+ 2010-12-25 rocky <rockyb@rubyforge.org>
25
+
26
+ * ext/add_to_parse_tree.inc, ext/parse_tree.c,
27
+ test/unit/test_parse_tree_for_str.rb: Add parse_tree_for_method. Add
28
+ more nodes types. New ones are largely untested. More work is
29
+ needed in a patched Rub to save method nodes
30
+
31
+ 2010-07-12 rocky <rockyb@rubyforge.org>
32
+
33
+ * Rakefile: Add include files to package/gem.
34
+
35
+ 2010-06-17 rocky <rockyb@rubyforge.org>
36
+
37
+ * ext/add_to_parse_tree.inc, test/unit/test_parse_tree_for_str.rb:
38
+ Add nodes array and values. Warning: array alen doesn't look like a
39
+ fixnum for the first array alen. It's also the same way in node.c or
40
+ parse_tree_dump.
41
+
42
+ 2010-06-16 rocky <rockyb@rubyforge.org>
43
+
44
+ * ext/add_to_parse_tree.inc, test/unit/test_parse_tree_for_str.rb:
45
+ Add nodes asgn1, zarray, and hash. Really need to add "array" next.
46
+
47
+
48
+ 2010-06-15 rocky <rockyb@rubyforge.org>
49
+
50
+ * ext/add_to_parse_tree.inc, test/unit/test_parse_tree_for_str.rb:
51
+ Add 'begin', 'rescue', 'resbody', and 'ensure'
52
+
53
+ 2010-06-11 rocky <rockyb@rubyforge.org>
54
+
55
+ * ext/add_to_parse_tree.inc, test/unit/test_parse_tree_for_str.rb:
56
+ Add nodes: case, when, opt_n, while, until, gasn, dot2, dot2, flip2,
57
+ and flip3. Some of these remain untested.
58
+
59
+ 2010-06-10 rocky <rockyb@rubyforge.org>
60
+
61
+ * ext/add_to_parse_tree.inc: Add nodes 'iter', 'for', 'call', and
62
+ 'fcall'
63
+
64
+ 2010-06-10 rocky <rockyb@rubyforge.org>
65
+
66
+ * ext/add_to_parse_tree.inc: Add nodes block, if, alias, valias and
67
+ undef.
68
+
69
+ 2010-06-09 rocky <rockyb@rubyforge.org>
70
+
71
+ * ext/add_to_parse_tree.inc, ext/parse_tree.c: Add nodes 'and',
72
+ 'or', 'zsuper', and 'vcall'. Split longish add_to_parse_tree()
73
+ routine into a separate file. F_NODE() now matches node.c's better.
74
+
75
+
76
+ 2010-06-09 rocky <rockyb@rubyforge.org>
77
+
78
+ * ext/parse_tree.c: Add "break", "next", and "return"
79
+
80
+ 2010-06-09 rocky <rockyb@rubyforge.org>
81
+
82
+ * ext/parse_tree.c: Add gvar
83
+
84
+ 2010-06-09 rocky <rockyb@rubyforge.org>
85
+
86
+ * ext/parse_tree.c, test/unit/test_parse_tree_for_str.rb: Add
87
+ op_asgn_and and opt_asgn_or
88
+
89
+ 2010-06-08 rocky <rockyb@rubyforge.org>
90
+
91
+ * test/unit/test_parse_tree_for_str.rb: Tests for new ops.
92
+
93
+ 2010-06-08 rocky <rockyb@rubyforge.org>
94
+
95
+ * ext/parse_tree.c: Add nilary opts: redo, retry, yield; some
96
+ variable assignments: lasgn, iasgn, cvasgn; variable and constant
97
+ refs: ivar, const, cvar, colon2, colon3 and 'defined?'.
98
+
99
+ 2010-06-07 rocky <rockyb@rubyforge.org>
100
+
101
+ * ext/parse_tree.c, include, test/unit/test_parse_tree_for_str.rb:
102
+ Add the various kinds of string and regexp literals.
103
+
104
+ 2010-06-07 R. Bernstein <rocky@gnu.org>
105
+
106
+ * include: Submodule stuff again
107
+
108
+ 2010-06-07 R. Bernstein <rocky@gnu.org>
109
+
110
+ * .gitmodules: Change submodule URL
111
+
112
+ 2010-06-07 R. Bernstein <rocky@gnu.org>
113
+
114
+ * include: Correct submodule path
115
+
116
+ 2010-06-07 rocky <rockyb@rubyforge.org>
117
+
118
+ * Rakefile, ext/parse_tree.c, test/.gitignore,
119
+ test/unit/.gitignore, test/unit/test_parse_tree_for_str.rb: Add NODE
120
+ types 'lit', 'str', and 'xstr'. Start unit tests.
121
+
122
+ 2010-06-07 rocky <rockyb@rubyforge.org>
123
+
124
+ * ext/parse_tree.c: We now handle NODE_TRUE, NODE_FALSE and NODE_NIL
125
+ - woohoo!
126
+
127
+ 2010-06-06 rocky <rockyb@rubyforge.org>
128
+
129
+ * Rakefile: "rake" and "rake gem" should now work.
130
+
131
+ 2010-06-06 rocky <rockyb@rubyforge.org>
132
+
133
+ * ext/parse_tree.c: Start to fill in node handling to see what is
134
+ involved. Looks like a merge of code with node.c with parse_tree.rb
135
+
136
+
137
+ 2010-06-06 rocky <rockyb@rubyforge.org>
138
+
139
+ * README.md: Wrong name. This time for sure!
140
+
141
+ 2010-06-06 rocky <rockyb@rubyforge.org>
142
+
143
+ * ext/.gitignore, ext/extconf.rb, ext/parse_tree.c: Method
144
+ parse_tree_dump - a wrapper for the routine in Ruby 1.9 dump.
145
+ Interim but possibly an encouraging first step.
146
+
147
+ 2010-06-06 rocky <rockyb@rubyforge.org>
148
+
149
+ * .gitmodules, include: Add common Ruby 1.9 headers as a submodule.
150
+
151
+
152
+ 2010-06-06 r <rocky@static-71-183-236-17.nycmny.fios.verizon.net>
153
+
154
+ * Start ParseTree for Ruby 1.9 - C-extension part
155
+
data/NEWS ADDED
@@ -0,0 +1,2 @@
1
+ December 25, 2010 (0.2)
2
+ First public release
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # rb-parsetree19
2
+
3
+ A C extension to support ParseTree in Ruby 1.9
4
+
5
+ ## Requirements
6
+
7
+ A patched version of Ruby 1.9.2 is needed. In fact the same patched version
8
+ as needed by rb-threadframe (and thus rbdbgr).
data/Rakefile ADDED
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env rake
2
+ # -*- Ruby -*-
3
+ require 'rubygems'
4
+ require 'rake/gempackagetask'
5
+ require 'rake/rdoctask'
6
+ require 'rake/testtask'
7
+
8
+ rake_dir = File.dirname(__FILE__)
9
+
10
+ require 'rbconfig'
11
+ RUBY_PATH = File.join(Config::CONFIG['bindir'],
12
+ Config::CONFIG['RUBY_INSTALL_NAME'])
13
+
14
+ SO_NAME = 'parsetree19.so'
15
+
16
+ PACKAGE_VERSION = open("ext/parse_tree.c") do |f|
17
+ f.grep(/^#define PARSETREE19_VERSION/).first[/"(.+)"/,1]
18
+ end
19
+
20
+ EXT_FILES = FileList[%w(ext/*.c ext/*.h ext/*.inc)]
21
+ INCLUDE_FILES = FileList['include/*.h']
22
+ LIB_FILES = FileList['lib/*.rb']
23
+ TEST_FILES = FileList['test/*/*.rb']
24
+ COMMON_FILES = FileList[%w(README.md Rakefile NEWS ChangeLog)]
25
+ ALL_FILES = COMMON_FILES + INCLUDE_FILES + LIB_FILES + EXT_FILES +
26
+ TEST_FILES
27
+
28
+ desc 'Create the core thread-frame shared library extension'
29
+ task :ext do
30
+ Dir.chdir('ext') do
31
+ system("#{Gem.ruby} extconf.rb && make")
32
+ end
33
+ end
34
+
35
+ desc 'Remove built files'
36
+ task :clean do
37
+ cd 'ext' do
38
+ if File.exist?('Makefile')
39
+ sh 'make clean'
40
+ rm 'Makefile'
41
+ end
42
+ derived_files = Dir.glob('.o') + Dir.glob('*.so')
43
+ rm derived_files unless derived_files.empty?
44
+ end
45
+ end
46
+
47
+ def run_standalone_ruby_file(directory)
48
+ puts ('*' * 10) + ' ' + directory + ' ' + ('*' * 10)
49
+ Dir.chdir(directory) do
50
+ Dir.glob('*.rb').each do |ruby_file|
51
+ puts ('-' * 20) + ' ' + ruby_file + ' ' + ('-' * 20)
52
+ system(RUBY_PATH, ruby_file)
53
+ end
54
+ end
55
+ end
56
+
57
+ desc "Create a GNU-style ChangeLog via git2cl"
58
+ task :ChangeLog do
59
+ system("git log --pretty --numstat --summary | git2cl > ChangeLog")
60
+ end
61
+
62
+ task :default => [:test]
63
+
64
+ desc 'Test units - the smaller tests'
65
+ Rake::TestTask.new(:'test:unit') do |t|
66
+ t.libs << './ext'
67
+ t.test_files = FileList['test/unit/**/*.rb']
68
+ # t.pattern = 'test/**/*test-*.rb' # instead of above
69
+ t.verbose = true
70
+ end
71
+ task :'test:unit' => [:ext]
72
+
73
+ desc 'Test everything - unit tests for now.'
74
+ task :test do
75
+ exceptions = ['test:unit'].collect do |task|
76
+ begin
77
+ Rake::Task[task].invoke
78
+ nil
79
+ rescue => e
80
+ e
81
+ end
82
+ end.compact
83
+
84
+ exceptions.each {|e| puts e;puts e.backtrace }
85
+ raise "Test failures" unless exceptions.empty?
86
+ end
87
+
88
+ desc "Test everything - same as test."
89
+
90
+ task :'check' do
91
+ run_standalone_ruby_file(File.join(%W(#{rake_dir} test unit)))
92
+ end
93
+
94
+ # --------- RDoc Documentation ------
95
+ desc 'Generate rdoc documentation'
96
+ Rake::RDocTask.new('rdoc') do |rdoc|
97
+ rdoc.rdoc_dir = 'doc/rdoc'
98
+ rdoc.title = 'parsetree19'
99
+ # Show source inline with line numbers
100
+ rdoc.options << '--inline-source' << '--line-numbers'
101
+ # Make the readme file the start page for the generated html
102
+ rdoc.options << '--main' << 'README.md'
103
+ rdoc.rdoc_files.include('ext/**/*.c',
104
+ 'README.md')
105
+ end
106
+
107
+ # Base GEM Specification
108
+ spec = Gem::Specification.new do |spec|
109
+ spec.name = "parsetree19"
110
+
111
+ spec.homepage = "http://github.com/rocky/rb-parsetree19/tree/master"
112
+ spec.summary = "Frame introspection"
113
+ spec.description = <<-EOF
114
+
115
+ rb-parsetree is the C extension part of ParseTree for Ruby 1.9.
116
+ EOF
117
+
118
+ spec.version = PACKAGE_VERSION
119
+ spec.require_path = 'lib'
120
+ spec.extensions = ["ext/extconf.rb"]
121
+
122
+ spec.author = "R. Bernstein"
123
+ spec.email = "rockyb@rubyforge.org"
124
+ spec.platform = Gem::Platform::RUBY
125
+ spec.files = ALL_FILES.to_a
126
+
127
+ spec.required_ruby_version = '~> 1.9.2frame'
128
+ spec.date = Time.now
129
+ # spec.rubyforge_project = 'rocky-hacks'
130
+
131
+ # rdoc
132
+ spec.has_rdoc = true
133
+ spec.extra_rdoc_files = ['README.md'] + FileList['ext/*.c']
134
+ end
135
+
136
+ # Rake task to build the default package
137
+ Rake::GemPackageTask.new(spec) do |pkg|
138
+ pkg.need_tar = true
139
+ end
140
+
141
+ def install(spec, *opts)
142
+ args = ['gem', 'install', "pkg/#{spec.name}-#{spec.version}.gem"] + opts
143
+ system(*args)
144
+ end
145
+
146
+ desc 'Install locally'
147
+ task :install => :package do
148
+ Dir.chdir(File::dirname(__FILE__)) do
149
+ # ri and rdoc take lots of time
150
+ install(spec, '--no-ri', '--no-rdoc')
151
+ end
152
+ end
153
+
154
+ task :install_full => :package do
155
+ Dir.chdir(File::dirname(__FILE__)) do
156
+ install(spec)
157
+ end
158
+ end