rubocop-ast 1.2.0 → 1.3.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f538f2ba2d235b12111dfc20f5cb568ed1212310bf90f3f9abf783866153b93
|
4
|
+
data.tar.gz: 9a67f643a7b4371f6592a846664933cd56399689a3c8005ef4ef8ddfb4857341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df6cd1a8593620ac41fc08a9798b5c0e5c2973f62d8068605435f6d0231ab0ccd9555610645951d2550f7150753395f64d4ffd9d8fe74b40ffbce6a095f3ce1
|
7
|
+
data.tar.gz: c4d67ddff04232bead212dcc7632ac3e5195c29f0314a5137c0c2da57ba7805f386600f4a21fdd490d7a0988165974482fc1e60a7aed9227a9f37466b79e85eb
|
@@ -13,7 +13,8 @@ class RuboCop::AST::NodePattern::LexerRex
|
|
13
13
|
macros
|
14
14
|
CONST_NAME /[A-Z:][a-zA-Z_:]+/
|
15
15
|
SYMBOL_NAME /[\w+@*\/?!<>=~|%^-]+|\[\]=?/
|
16
|
-
IDENTIFIER /[a-
|
16
|
+
IDENTIFIER /[a-z][a-zA-Z0-9_]*/
|
17
|
+
NODE_TYPE /[a-z][a-zA-Z0-9_-]*/ # Same as identifier but allows '-'
|
17
18
|
CALL /(?:#{CONST_NAME}\.)?#{IDENTIFIER}[!?]?/
|
18
19
|
REGEXP_BODY /(?:[^\/]|\\\/)*/
|
19
20
|
REGEXP /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
|
@@ -27,14 +28,14 @@ rules
|
|
27
28
|
%w"( ) { | } [ ] < > $ ! ^ ` ... + * ? ,"
|
28
29
|
)}/o { emit ss.matched, &:to_sym }
|
29
30
|
/#{REGEXP}/o { emit_regexp }
|
30
|
-
|
31
|
+
/%?(#{CONST_NAME})/o { emit :tPARAM_CONST }
|
31
32
|
/%([a-z_]+)/ { emit :tPARAM_NAMED }
|
32
33
|
/%(\d*)/ { emit(:tPARAM_NUMBER) { |s| s.empty? ? 1 : s.to_i } } # Map `%` to `%1`
|
33
34
|
/_(#{IDENTIFIER})/o { emit :tUNIFY }
|
34
35
|
/_/o { emit :tWILDCARD }
|
35
36
|
/\#(#{CALL})/o { @state = :ARG; emit :tFUNCTION_CALL, &:to_sym }
|
36
37
|
/#{IDENTIFIER}\?/o { @state = :ARG; emit :tPREDICATE, &:to_sym }
|
37
|
-
/#{
|
38
|
+
/#{NODE_TYPE}/o { emit :tNODE_TYPE, &:to_sym }
|
38
39
|
:ARG /\(/ { @state = nil; emit :tARG_LIST }
|
39
40
|
:ARG // { @state = nil }
|
40
41
|
/\#.*/ { emit_comment }
|
@@ -26,7 +26,8 @@ class RuboCop::AST::NodePattern::LexerRex
|
|
26
26
|
# :stopdoc:
|
27
27
|
CONST_NAME = /[A-Z:][a-zA-Z_:]+/
|
28
28
|
SYMBOL_NAME = /[\w+@*\/?!<>=~|%^-]+|\[\]=?/
|
29
|
-
IDENTIFIER = /[a-
|
29
|
+
IDENTIFIER = /[a-z][a-zA-Z0-9_]*/
|
30
|
+
NODE_TYPE = /[a-z][a-zA-Z0-9_-]*/
|
30
31
|
CALL = /(?:#{CONST_NAME}\.)?#{IDENTIFIER}[!?]?/
|
31
32
|
REGEXP_BODY = /(?:[^\/]|\\\/)*/
|
32
33
|
REGEXP = /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
|
@@ -134,7 +135,7 @@ class RuboCop::AST::NodePattern::LexerRex
|
|
134
135
|
action { emit ss.matched, &:to_sym }
|
135
136
|
when ss.skip(/#{REGEXP}/o) then
|
136
137
|
action { emit_regexp }
|
137
|
-
when ss.skip(
|
138
|
+
when ss.skip(/%?(#{CONST_NAME})/o) then
|
138
139
|
action { emit :tPARAM_CONST }
|
139
140
|
when ss.skip(/%([a-z_]+)/) then
|
140
141
|
action { emit :tPARAM_NAMED }
|
@@ -148,7 +149,7 @@ class RuboCop::AST::NodePattern::LexerRex
|
|
148
149
|
action { @state = :ARG; emit :tFUNCTION_CALL, &:to_sym }
|
149
150
|
when ss.skip(/#{IDENTIFIER}\?/o) then
|
150
151
|
action { @state = :ARG; emit :tPREDICATE, &:to_sym }
|
151
|
-
when ss.skip(/#{
|
152
|
+
when ss.skip(/#{NODE_TYPE}/o) then
|
152
153
|
action { emit :tNODE_TYPE, &:to_sym }
|
153
154
|
when ss.skip(/\#.*/) then
|
154
155
|
action { emit_comment }
|
data/lib/rubocop/ast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|