live_ast_ruby_parser 0.6.2 → 0.6.3
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/CHANGES.rdoc +4 -0
- data/lib/live_ast_ruby_parser.rb +1 -1
- data/lib/live_ast_ruby_parser/test.rb +27 -0
- data/lib/live_ast_ruby_parser/version.rb +1 -1
- metadata +3 -5
data/CHANGES.rdoc
CHANGED
data/lib/live_ast_ruby_parser.rb
CHANGED
@@ -30,6 +30,17 @@ module LiveASTRubyParser::Test
|
|
30
30
|
s(:defn, name, s(:args), s(:scope, s(:block, s(:str, ret))))
|
31
31
|
end
|
32
32
|
|
33
|
+
#
|
34
|
+
# singleton_no_arg_def(:f, "foo") returns the ast of
|
35
|
+
#
|
36
|
+
# def self.f
|
37
|
+
# "foo"
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
def singleton_no_arg_def(name, ret)
|
41
|
+
s(:defs, s(:self), name, s(:args), s(:scope, s(:block, s(:str, ret))))
|
42
|
+
end
|
43
|
+
|
33
44
|
#
|
34
45
|
# no_arg_def_return(no_arg_def(:f, "A#f")) == "A#f"
|
35
46
|
#
|
@@ -52,6 +63,22 @@ module LiveASTRubyParser::Test
|
|
52
63
|
s(:block, s(:call, s(:lvar, :x), op, s(:arglist, s(:lvar, :y))))))
|
53
64
|
end
|
54
65
|
|
66
|
+
#
|
67
|
+
# singleton_binop_def(:A, :f, :+) returns the ast of
|
68
|
+
#
|
69
|
+
# def A.f(x, y)
|
70
|
+
# x + y
|
71
|
+
# end
|
72
|
+
#
|
73
|
+
def singleton_binop_def(const, name, op)
|
74
|
+
s(:defs,
|
75
|
+
s(:const, const),
|
76
|
+
name,
|
77
|
+
s(:args, :x, :y),
|
78
|
+
s(:scope,
|
79
|
+
s(:block, s(:call, s(:lvar, :x), op, s(:arglist, s(:lvar, :y))))))
|
80
|
+
end
|
81
|
+
|
55
82
|
#
|
56
83
|
# binop_define_method(:f, :*) returns the ast of
|
57
84
|
#
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: live_ast_ruby_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James M. Lawrence
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-05-17 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: ruby_parser
|
@@ -55,7 +54,6 @@ files:
|
|
55
54
|
- lib/live_ast_ruby_parser/unparser.rb
|
56
55
|
- lib/live_ast_ruby_parser/version.rb
|
57
56
|
- MANIFEST
|
58
|
-
has_rdoc: true
|
59
57
|
homepage: http://quix.github.com/live_ast_ruby_parser
|
60
58
|
licenses: []
|
61
59
|
|
@@ -82,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
80
|
requirements: []
|
83
81
|
|
84
82
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.7.1
|
86
84
|
signing_key:
|
87
85
|
specification_version: 3
|
88
86
|
summary: This is the default RubyParser-based parser used by LiveAST.
|