parser_node_ext 1.2.0 → 1.2.2

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: 50b2c36e35c4dd8b37aa4d82eb72389f550aa9733f15f9f6254dd346b9fd0e2c
4
- data.tar.gz: 879f64142437e5021fe5c3b4a5421085020ac7117c24c57c229bfd8ece65a757
3
+ metadata.gz: f6c6c18cd96c8260a6318584861952e15597a1e89e3ad765459cbcd7ee09811e
4
+ data.tar.gz: 9b60771fe8b4428ef615e0bc7064d275027f3a292c13b2936266b1e19c0c2178
5
5
  SHA512:
6
- metadata.gz: 19cc544cc2cd288872940aab7dd8a82a2a4df11d25f8c0760068955ed12ea2cb7c28e6b2bc6b35ef887ad9a451e0ff0bcc88b3c8efcc533c73b55efa6e645194
7
- data.tar.gz: 75762b11d8e7f6d82ba7c9b788b3ef87297ac656f623b707ba22b21eee48b7394f7030dc4c9a18517b7f4bc7c1b690e6138d11a707552ea99920f5948bfb1118
6
+ metadata.gz: cd2ebf1060bca500fb0ea333ddd8819040095566ccf385eafed3bfe0da15f9d5659147e83547d2a714a7393debc934c3c791404d0595d7ca3fbaa29d0434b3f4
7
+ data.tar.gz: 9238796ab318e28ec2a1df877142985d4461e39d74923ff5055ab3fcc4267ca234c1ce89110ef3e947b1f1bfc136c168486962db36ec952342b1617123423cb0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.2 (2024-02-10)
4
+
5
+ * Remove `to_hash` extend
6
+
7
+ ## 1.2.1 (2023-10-01)
8
+
9
+ * Do not handle `irange` and `erange` in `to_value`
10
+
3
11
  ## 1.2.0 (2023-06-10)
4
12
 
5
13
  * Separate `kwsplats` from hash `pairs`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parser_node_ext (1.2.0)
4
+ parser_node_ext (1.2.2)
5
5
  parser
6
6
 
7
7
  GEM
@@ -9,10 +9,10 @@ GEM
9
9
  specs:
10
10
  ast (2.4.2)
11
11
  diff-lcs (1.5.0)
12
- parser (3.2.2.3)
12
+ parser (3.3.0.5)
13
13
  ast (~> 2.4.1)
14
14
  racc
15
- racc (1.7.0)
15
+ racc (1.7.3)
16
16
  rake (13.0.6)
17
17
  rspec (3.11.0)
18
18
  rspec-core (~> 3.11.0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParserNodeExt
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.2"
5
5
  end
@@ -431,10 +431,6 @@ module ParserNodeExt
431
431
  nil
432
432
  when :array
433
433
  children.map(&:to_value)
434
- when :irange
435
- (children.first.to_value..children.last.to_value)
436
- when :erange
437
- (children.first.to_value...children.last.to_value)
438
434
  when :begin, :kwbegin
439
435
  children.first.to_value
440
436
  else
@@ -449,28 +445,6 @@ module ParserNodeExt
449
445
  loc.expression&.source
450
446
  end
451
447
 
452
- # Convert node to a hash, so that it can be converted to a json.
453
- def to_hash
454
- result = { node_type: type }
455
- if TYPE_CHILDREN[type]
456
- TYPE_CHILDREN[type].each do |key|
457
- value = send(key)
458
- result[key] =
459
- case value
460
- when Array
461
- value.map { |v| v.respond_to?(:to_hash) ? v.to_hash : v }
462
- when Parser::AST::Node
463
- value.to_hash
464
- else
465
- value
466
- end
467
- end
468
- else
469
- result[:children] = children.map { |c| c.respond_to?(:to_hash) ? c.to_hash : c }
470
- end
471
- result
472
- end
473
-
474
448
  # Respond key value and source for hash node, e.g.
475
449
  # @example
476
450
  # node # s(:hash, s(:pair, s(:sym, :foo), s(:sym, :bar)))
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: 1.2.0
4
+ version: 1.2.2
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-06-10 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.4.13
65
+ rubygems_version: 3.5.3
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: extend parser node