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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b8e767611058d830b6776b2464980e8c5dcd8d4
4
- data.tar.gz: 6dfcf976bf8e0ef3b18c43ce05348df49c220065
3
+ metadata.gz: 62c5342904643f85611348d75c6ded114b5b42bc
4
+ data.tar.gz: ea6cecdaf0f0f028ec06b03b2d58d59b863f8cf4
5
5
  SHA512:
6
- metadata.gz: 7dff35a591b5b13e7d6eafc47e1ec8dd9be51535ef7d51b4d89045398581c4f5e83c1115abf81390ae8e96789027874904e3706d635192b50da19789d27fb7e5
7
- data.tar.gz: 72c455cbdf9e6ae83fd51bc1e88b7d617097e8d7d145bbc62bbd609614ba1a95f594c1d6f2f2fe224945a4c542a027270634489ea4c929da758aea0c0974a1e0
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*\((?:\)|([^\)]+\)))/ do |mthdnme, argslst|
39
- [:def, mthdnme, argslst]
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
- r << [:class]
76
+ name, baseclass = remaining
77
+ r << [:class, name]
75
78
  r.last.concat treeize(a)
76
79
 
77
80
  when :def
78
81
 
79
- r << [:def]
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
- r << [:method_call]
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file