rbparser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rbparser.rb +12 -7
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62c5342904643f85611348d75c6ded114b5b42bc
|
4
|
+
data.tar.gz: ea6cecdaf0f0f028ec06b03b2d58d59b863f8cf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01522e3b37745e2af39a4506a20783549b06c48a4e8bdb195a727b16b3b38cca809907a9f5da34239732bb491c355fd50cdcf757445ecde3f7fe76111a2b7099
|
7
|
+
data.tar.gz: 0090320f56e230f08329433bbf2d37ce89c166134403286b85e3f8bd35b68bfddee733b8ce47dbe3baf6123d422339aed59b7eca361d1a698b41716f104ee427
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rbparser.rb
CHANGED
@@ -35,8 +35,10 @@ class RbParser
|
|
35
35
|
[:end]
|
36
36
|
end
|
37
37
|
|
38
|
-
parse /def\s+(\w+)\s*\((?:\)|([^\)]
|
39
|
-
[:def, mthdnme
|
38
|
+
parse /def\s+(\w+)\s*\((?:\)|([^\)]+)\))/ do |mthdnme, argslst|
|
39
|
+
r = [:def, mthdnme]
|
40
|
+
r << argslst if argslst
|
41
|
+
r
|
40
42
|
end
|
41
43
|
|
42
44
|
get /(\w+)\(([^\)]+)\)/ do |mthdnme, argslst|
|
@@ -71,17 +73,20 @@ class RbParser
|
|
71
73
|
case id
|
72
74
|
when :class
|
73
75
|
|
74
|
-
|
76
|
+
name, baseclass = remaining
|
77
|
+
r << [:class, name]
|
75
78
|
r.last.concat treeize(a)
|
76
79
|
|
77
80
|
when :def
|
78
81
|
|
79
|
-
|
82
|
+
name, *args = remaining
|
83
|
+
r << [:def, name.to_sym, args]
|
80
84
|
r.last.concat treeize(a)
|
81
85
|
|
82
86
|
when :method
|
83
|
-
|
84
|
-
|
87
|
+
|
88
|
+
name, *args = remaining
|
89
|
+
r << [:method_call, name.to_sym, args]
|
85
90
|
|
86
91
|
when :end
|
87
92
|
|
@@ -94,4 +99,4 @@ class RbParser
|
|
94
99
|
r
|
95
100
|
end
|
96
101
|
|
97
|
-
end
|
102
|
+
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|