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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09b9c1f0df70d2a83780b534cb42635c55b0dfb68165b40fa07247f251d6e344'
4
- data.tar.gz: 0ef177a30d4fdacf17d9c36dfcf9e42b4ea7e94142422c9d064dc1cd41a8674d
3
+ metadata.gz: 3e35bf56931447c5e56c2c88c387607230701259e1c8cbc56a347901bc7019e3
4
+ data.tar.gz: 3c0dd82b73f35f2f4b61ca4d0795293102fe9f18c325f305b21b344d68367a00
5
5
  SHA512:
6
- metadata.gz: 5825839d2153c0d21fc96ba7ee3e6b2c30490966255bb6331cac40224ceb31a426ef86c36cfb3c8ad93d69f14e4a6eb096b582bb731ad69dda0c25467a9acda8
7
- data.tar.gz: b664575b41717991f2fc7c2a562990c876fa2239cb3d982a1ce9dea9d2bb7316bab755a6c1e3b5e380c39a2b5ccc53fe0d62c38fa3c3c019cf5f52cc724ced75
6
+ metadata.gz: 218616f2d89d224c5cf4f930581f5a3389e076e6cab3674c2551bd432d6928d08cfc429d3cb6ccf62b2f3d51d45927d173403311c8e20cab594f5a5230797fbe
7
+ data.tar.gz: ab05bcb20c20dcc05ee88333678bf0b9df529953f80bb6bda4717b70be6c238842909bc52d465f7041df00ab6221276a776e57e5a405851a60dcc4c9914807a8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.8.0 (2023-01-30)
4
+
5
+ * Support `numblock` node
6
+
3
7
  ## 0.7.0 (2023-01-28)
4
8
 
5
9
  * Support `elements` for `array` node
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parser_node_ext (0.7.0)
4
+ parser_node_ext (0.8.0)
5
5
  parser
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParserNodeExt
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
@@ -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 and :module node.
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]
@@ -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.7.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-27 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser