parser_node_ext 0.9.0 → 0.10.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: 8fb070ea09b73310d3bb9acdcae0cbc06c6e3120b7d1bd69de94045c48cabcfa
4
- data.tar.gz: 4014d1088f929cb56e5865b11500f58242263685ba64a140b29d9f9166fdeaf6
3
+ metadata.gz: 8388605e7f3d89e3402c9e7c1cc98c29ed6466d20a5c81f1e4cb50d7c1c106e1
4
+ data.tar.gz: fba4d0f2c09519f0742cbd4b938bf2709cb4eaa0149e545614573fa56f9f9718
5
5
  SHA512:
6
- metadata.gz: 77c947f3bfc188aef814ec8214cf46af0d76d7aabe9c5c99af2c63c7838073bf9c8cd3bdae71e248238cb5c16690d71e91afefc9f23ce791284a46eac7957946
7
- data.tar.gz: 5afac291cda433af31d1965c023fcc0662cf07e6cdd6c80a9932b23f2851978b501b09fa0a61b128e325bc7eb714d1e5efb09024ac06c802bade0656715e01cf
6
+ metadata.gz: 2ee11cb2b9942cdd8418e3f5556afc8d6b9c25a560efde35fea402f3a269d71fe7176d9e3326902eb2976a251240e5a844596b126c90752f0de7acc998fbf4ad
7
+ data.tar.gz: 889c68539a90e2c4c5ecd5d29ad33febbb5119a909bf2dd6e4e4cafbcdc34fa3250bf8ebde5a7e7091af79b3219438784683b8177ff2dd618c2ab67169e78086
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.10.0 (2023-02-01)
4
+
5
+ * Support `erange` and `irange` nodes
6
+
7
+ ## 0.9.1 (2023-02-01)
8
+
9
+ * Fix `module` node `body` method
10
+
3
11
  ## 0.9.0 (2023-02-01)
4
12
 
5
13
  * Support pattern match nodes, `case_match`, `in_pattern`, `hash_pattern`, `array_pattern`, `find_pattern`, `match_pattern`, `match_pattern_p`, `match_var`, `match_as`, `pin`, `match_rest`, `if_guard` and `unless_guard`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parser_node_ext (0.9.0)
4
+ parser_node_ext (0.10.0)
5
5
  parser
6
6
 
7
7
  GEM
@@ -27,9 +27,7 @@ GEM
27
27
  rspec-support (3.11.0)
28
28
 
29
29
  PLATFORMS
30
- x86_64-darwin-21
31
- x86_64-darwin-22
32
- x86_64-linux
30
+ ruby
33
31
 
34
32
  DEPENDENCIES
35
33
  parser_node_ext!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParserNodeExt
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
@@ -26,6 +26,7 @@ module ParserNodeExt
26
26
  def: %i[name arguments body],
27
27
  defined?: %i[arguments],
28
28
  defs: %i[self name arguments body],
29
+ erange: %i[begin end],
29
30
  false: [],
30
31
  find_pattern: %i[elements],
31
32
  float: %i[value],
@@ -35,6 +36,7 @@ module ParserNodeExt
35
36
  if_guard: %i[expression],
36
37
  int: %i[value],
37
38
  in_pattern: %i[expression guard body],
39
+ irange: %i[begin end],
38
40
  ivasgn: %i[left_value right_value],
39
41
  ivar: %i[name],
40
42
  lvar: %i[name],
@@ -159,11 +161,11 @@ module ParserNodeExt
159
161
  case type
160
162
  when :begin
161
163
  children
162
- when :when
164
+ when :when, :module
163
165
  return [] if children[1].nil?
164
166
 
165
167
  :begin == children[1].type ? children[1].body : children[1..-1]
166
- when :def, :block, :class, :module, :numblock, :in_pattern
168
+ when :def, :block, :class, :numblock, :in_pattern
167
169
  return [] if children[2].nil?
168
170
 
169
171
  :begin == children[2].type ? children[2].body : children[2..-1]
@@ -4,10 +4,12 @@ module ParserNodeExt
4
4
 
5
5
  def arguments: () -> Array[Parser::AST::Node]
6
6
  def arguments_count: () -> Integer
7
+ def begin: () -> Parser::AST::Node
7
8
  def body: () -> Array[Parser::AST::Node]
8
9
  def caller: () -> Parser::AST::Node
9
10
  def elements: () -> Array[Parser::AST::Node]
10
11
  def else_statement: () -> Parser::AST::Node
12
+ def end: () -> Parser::AST::Node
11
13
  def expression: () -> Parser::AST::Node
12
14
  def if_statement: () -> Parser::AST::Node
13
15
  def in_statements: () -> Array[Parser::AST::Node]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parser_node_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang