code-ruby-parser 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/parse-docs +6 -0
- data/lib/code/parser/equal.rb +33 -4
- data/lib/template/parser.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3e647bf3d41f5621be93a7310057002d71ea02eef1b6a5a6eed283d5ff43939
|
4
|
+
data.tar.gz: 79f489764b7917e8692cae7227f7f895b0104c59465fbcf52f34f0886e2c2d3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9bc1d2ccda202cc1da972babdcaaf96418f6e17ccce5247d840fad78b478cd300f0780933a5a6b20f659c7c96dcaac4334597610a9162eeb64d453666e744a5
|
7
|
+
data.tar.gz: b08df0949e99f19a10f5a932d975bf4d67941987a873214cf5d56d001052cf7f08dbf9732140a3fc6fb852d7df67c82cba1019e49870960c622c1a56b3ccd28d
|
data/CHANGELOG.md
CHANGED
data/bin/parse-docs
ADDED
data/lib/code/parser/equal.rb
CHANGED
@@ -2,13 +2,13 @@ class Code
|
|
2
2
|
class Parser
|
3
3
|
class Equal < ::Code::Parser
|
4
4
|
def parse
|
5
|
-
left = parse_subclass(::Code::Parser::Rescue)
|
6
|
-
|
7
5
|
previous_cursor = cursor
|
8
6
|
|
7
|
+
left = parse_left
|
8
|
+
|
9
9
|
comments_before = parse_comments
|
10
10
|
|
11
|
-
if operator = match(EQUALS)
|
11
|
+
if left && operator = match(EQUALS)
|
12
12
|
comments_after = parse_comments
|
13
13
|
|
14
14
|
right = parse_subclass(::Code::Parser::Equal)
|
@@ -25,7 +25,36 @@ class Code
|
|
25
25
|
else
|
26
26
|
@cursor = previous_cursor
|
27
27
|
buffer!
|
28
|
-
|
28
|
+
parse_next
|
29
|
+
end
|
30
|
+
else
|
31
|
+
@cursor = previous_cursor
|
32
|
+
buffer!
|
33
|
+
parse_next
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def parse_next
|
40
|
+
parse_subclass(::Code::Parser::Rescue)
|
41
|
+
end
|
42
|
+
|
43
|
+
def parse_left
|
44
|
+
left = parse_subclass(::Code::Parser::Name)
|
45
|
+
return unless left
|
46
|
+
|
47
|
+
previous_cursor = cursor
|
48
|
+
comments_before = parse_comments
|
49
|
+
|
50
|
+
if match(DOT) || match(COLON + COLON)
|
51
|
+
right = parse_subclass(::Code::Parser::Name)
|
52
|
+
if right
|
53
|
+
{ left: left, right: right }
|
54
|
+
else
|
55
|
+
@cursor = previous_cursor
|
56
|
+
buffer!
|
57
|
+
return
|
29
58
|
end
|
30
59
|
else
|
31
60
|
@cursor = previous_cursor
|
data/lib/template/parser.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code-ruby-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
@@ -23,6 +23,7 @@ files:
|
|
23
23
|
- Gemfile.lock
|
24
24
|
- bin/code-parser
|
25
25
|
- bin/format
|
26
|
+
- bin/parse-docs
|
26
27
|
- bin/push
|
27
28
|
- bin/template-parser
|
28
29
|
- code-ruby-parser.gemspec
|