parser_node_ext 0.7.0 → 0.8.0
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/Gemfile.lock +1 -1
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +3 -2
- data/sig/parser_node_ext.rbs +1 -0
- 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: 3e35bf56931447c5e56c2c88c387607230701259e1c8cbc56a347901bc7019e3
|
4
|
+
data.tar.gz: 3c0dd82b73f35f2f4b61ca4d0795293102fe9f18c325f305b21b344d68367a00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 218616f2d89d224c5cf4f930581f5a3389e076e6cab3674c2551bd432d6928d08cfc429d3cb6ccf62b2f3d51d45927d173403311c8e20cab594f5a5230797fbe
|
7
|
+
data.tar.gz: ab05bcb20c20dcc05ee88333678bf0b9df529953f80bb6bda4717b70be6c238842909bc52d465f7041df00ab6221276a776e57e5a405851a60dcc4c9914807a8
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/parser_node_ext.rb
CHANGED
@@ -35,6 +35,7 @@ module ParserNodeExt
|
|
35
35
|
masgn: %i[left_value right_value],
|
36
36
|
module: %i[name body],
|
37
37
|
nil: [],
|
38
|
+
numblock: %i[caller arguments_count body],
|
38
39
|
or: %i[left_value right_value],
|
39
40
|
or_asgn: %i[left_value right_value],
|
40
41
|
pair: %i[key value],
|
@@ -134,7 +135,7 @@ module ParserNodeExt
|
|
134
135
|
end
|
135
136
|
|
136
137
|
# Get body of node.
|
137
|
-
# It supports :begin, :block, :class, :def, :defs
|
138
|
+
# It supports :begin, :block, :class, :def, :defs, :module, :numblock node.
|
138
139
|
# @example
|
139
140
|
# node # s(:block, s(:send, s(:const, nil, :RSpec), :configure), s(:args, s(:arg, :config)), s(:send, nil, :include, s(:const, s(:const, nil, :EmailSpec), :Helpers)))
|
140
141
|
# node.body # [s(:send, nil, :include, s(:const, s(:const, nil, :EmailSpec), :Helpers))]
|
@@ -148,7 +149,7 @@ module ParserNodeExt
|
|
148
149
|
return [] if children[1].nil?
|
149
150
|
|
150
151
|
:begin == children[1].type ? children[1].body : children[1..-1]
|
151
|
-
when :def, :block, :class, :module
|
152
|
+
when :def, :block, :class, :module, :numblock
|
152
153
|
return [] if children[2].nil?
|
153
154
|
|
154
155
|
:begin == children[2].type ? children[2].body : children[2..-1]
|
data/sig/parser_node_ext.rbs
CHANGED
@@ -3,6 +3,7 @@ module ParserNodeExt
|
|
3
3
|
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
4
4
|
|
5
5
|
def arguments: () -> Array[Parser::AST::Node]
|
6
|
+
def arguments_count: () -> Integer
|
6
7
|
def body: () -> Array[Parser::AST::Node]
|
7
8
|
def caller: () -> Parser::AST::Node
|
8
9
|
def elements: () -> Array[Parser::AST::Node]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser_node_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|