rubocop-ast 1.27.0 → 1.28.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/ast/builder.rb +71 -70
- data/lib/rubocop/ast/node/keyword_splat_node.rb +10 -3
- data/lib/rubocop/ast/node_pattern/compiler/atom_subcompiler.rb +1 -1
- data/lib/rubocop/ast/node_pattern/parser.racc.rb +1 -1
- data/lib/rubocop/ast/processed_source.rb +1 -1
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35637162017455f25a93b82ace91c60d10ef01db306b812a05335ca84a2446e8
|
4
|
+
data.tar.gz: 7baca648669bf1f6bd5c9b6880a57cae31fd62cf0e9b0cd8e5ec2b3c5f644cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3445c27a6992b0a1a4895c233743754b47636857986917c0a3d0eafa38afb4b82260ab01f48ed24d9fe35858578a7343270893476bafe8bae182b230cd73766
|
7
|
+
data.tar.gz: 55f86a1621b6e73ff97d29c8f37a0a3518560b29baf97c450254fc4b9f874e45c27e7ce83450aec72d735dfffd9455b63973ef5396c7a19d1700a130c9ecfd5d
|
data/lib/rubocop/ast/builder.rb
CHANGED
@@ -19,76 +19,77 @@ module RuboCop
|
|
19
19
|
|
20
20
|
# @api private
|
21
21
|
NODE_MAP = {
|
22
|
-
and:
|
23
|
-
and_asgn:
|
24
|
-
alias:
|
25
|
-
arg:
|
26
|
-
blockarg:
|
27
|
-
forward_arg:
|
28
|
-
kwarg:
|
29
|
-
kwoptarg:
|
30
|
-
kwrestarg:
|
31
|
-
optarg:
|
32
|
-
restarg:
|
33
|
-
shadowarg:
|
34
|
-
args:
|
35
|
-
array:
|
36
|
-
lvasgn:
|
37
|
-
ivasgn:
|
38
|
-
cvasgn:
|
39
|
-
gvasgn:
|
40
|
-
block:
|
41
|
-
numblock:
|
42
|
-
break:
|
43
|
-
case_match:
|
44
|
-
casgn:
|
45
|
-
case:
|
46
|
-
class:
|
47
|
-
const:
|
48
|
-
def:
|
49
|
-
defined?:
|
50
|
-
defs:
|
51
|
-
dstr:
|
52
|
-
ensure:
|
53
|
-
for:
|
54
|
-
forward_args:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
22
|
+
and: AndNode,
|
23
|
+
and_asgn: AndAsgnNode,
|
24
|
+
alias: AliasNode,
|
25
|
+
arg: ArgNode,
|
26
|
+
blockarg: ArgNode,
|
27
|
+
forward_arg: ArgNode,
|
28
|
+
kwarg: ArgNode,
|
29
|
+
kwoptarg: ArgNode,
|
30
|
+
kwrestarg: ArgNode,
|
31
|
+
optarg: ArgNode,
|
32
|
+
restarg: ArgNode,
|
33
|
+
shadowarg: ArgNode,
|
34
|
+
args: ArgsNode,
|
35
|
+
array: ArrayNode,
|
36
|
+
lvasgn: AsgnNode,
|
37
|
+
ivasgn: AsgnNode,
|
38
|
+
cvasgn: AsgnNode,
|
39
|
+
gvasgn: AsgnNode,
|
40
|
+
block: BlockNode,
|
41
|
+
numblock: BlockNode,
|
42
|
+
break: BreakNode,
|
43
|
+
case_match: CaseMatchNode,
|
44
|
+
casgn: CasgnNode,
|
45
|
+
case: CaseNode,
|
46
|
+
class: ClassNode,
|
47
|
+
const: ConstNode,
|
48
|
+
def: DefNode,
|
49
|
+
defined?: DefinedNode,
|
50
|
+
defs: DefNode,
|
51
|
+
dstr: DstrNode,
|
52
|
+
ensure: EnsureNode,
|
53
|
+
for: ForNode,
|
54
|
+
forward_args: ForwardArgsNode,
|
55
|
+
forwarded_kwrestarg: KeywordSplatNode,
|
56
|
+
float: FloatNode,
|
57
|
+
hash: HashNode,
|
58
|
+
if: IfNode,
|
59
|
+
in_pattern: InPatternNode,
|
60
|
+
int: IntNode,
|
61
|
+
index: IndexNode,
|
62
|
+
indexasgn: IndexasgnNode,
|
63
|
+
irange: RangeNode,
|
64
|
+
erange: RangeNode,
|
65
|
+
kwargs: HashNode,
|
66
|
+
kwsplat: KeywordSplatNode,
|
67
|
+
lambda: LambdaNode,
|
68
|
+
module: ModuleNode,
|
69
|
+
next: NextNode,
|
70
|
+
op_asgn: OpAsgnNode,
|
71
|
+
or_asgn: OrAsgnNode,
|
72
|
+
or: OrNode,
|
73
|
+
pair: PairNode,
|
74
|
+
procarg0: Procarg0Node,
|
75
|
+
regexp: RegexpNode,
|
76
|
+
rescue: RescueNode,
|
77
|
+
resbody: ResbodyNode,
|
78
|
+
return: ReturnNode,
|
79
|
+
csend: CsendNode,
|
80
|
+
send: SendNode,
|
81
|
+
str: StrNode,
|
82
|
+
xstr: StrNode,
|
83
|
+
sclass: SelfClassNode,
|
84
|
+
super: SuperNode,
|
85
|
+
zsuper: SuperNode,
|
86
|
+
sym: SymbolNode,
|
87
|
+
until: UntilNode,
|
88
|
+
until_post: UntilNode,
|
89
|
+
when: WhenNode,
|
90
|
+
while: WhileNode,
|
91
|
+
while_post: WhileNode,
|
92
|
+
yield: YieldNode
|
92
93
|
}.freeze
|
93
94
|
|
94
95
|
# Generates {Node} from the given information.
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
module RuboCop
|
4
4
|
module AST
|
5
|
-
# A node extension for `kwsplat` nodes. This will be used in
|
6
|
-
# plain
|
7
|
-
#
|
5
|
+
# A node extension for `kwsplat` and `forwarded_kwrestarg` nodes. This will be used in
|
6
|
+
# place of a plain node when the builder constructs the AST, making its methods available to
|
7
|
+
# all `kwsplat` and `forwarded_kwrestarg` nodes within RuboCop.
|
8
8
|
class KeywordSplatNode < Node
|
9
9
|
include HashElementNode
|
10
10
|
|
@@ -41,6 +41,13 @@ module RuboCop
|
|
41
41
|
def node_parts
|
42
42
|
[self, self]
|
43
43
|
end
|
44
|
+
|
45
|
+
# This provides `forwarded_kwrestarg` node to return true to be compatible with `kwsplat` node.
|
46
|
+
#
|
47
|
+
# @return [true]
|
48
|
+
def kwsplat_type?
|
49
|
+
true
|
50
|
+
end
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
@@ -27,7 +27,7 @@ module RuboCop
|
|
27
27
|
# Defaults source encoding to UTF-8, regardless of the encoding it has
|
28
28
|
# been read with, which could be non-utf8 depending on the default
|
29
29
|
# external encoding.
|
30
|
-
source.force_encoding(Encoding::UTF_8) unless source.encoding == Encoding::UTF_8
|
30
|
+
(+source).force_encoding(Encoding::UTF_8) unless source.encoding == Encoding::UTF_8
|
31
31
|
|
32
32
|
@raw_source = source
|
33
33
|
@path = path
|
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.28.1
|
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: 2023-02
|
13
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|