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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +3 -3
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +0 -26
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6c6c18cd96c8260a6318584861952e15597a1e89e3ad765459cbcd7ee09811e
|
4
|
+
data.tar.gz: 9b60771fe8b4428ef615e0bc7064d275027f3a292c13b2936266b1e19c0c2178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd2ebf1060bca500fb0ea333ddd8819040095566ccf385eafed3bfe0da15f9d5659147e83547d2a714a7393debc934c3c791404d0595d7ca3fbaa29d0434b3f4
|
7
|
+
data.tar.gz: 9238796ab318e28ec2a1df877142985d4461e39d74923ff5055ab3fcc4267ca234c1ce89110ef3e947b1f1bfc136c168486962db36ec952342b1617123423cb0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
parser_node_ext (1.2.
|
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.
|
12
|
+
parser (3.3.0.5)
|
13
13
|
ast (~> 2.4.1)
|
14
14
|
racc
|
15
|
-
racc (1.7.
|
15
|
+
racc (1.7.3)
|
16
16
|
rake (13.0.6)
|
17
17
|
rspec (3.11.0)
|
18
18
|
rspec-core (~> 3.11.0)
|
data/lib/parser_node_ext.rb
CHANGED
@@ -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.
|
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:
|
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.
|
65
|
+
rubygems_version: 3.5.3
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: extend parser node
|