parser_node_ext 1.2.1 → 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 +4 -0
- data/Gemfile.lock +3 -3
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +0 -22
- 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
@@ -445,28 +445,6 @@ module ParserNodeExt
|
|
445
445
|
loc.expression&.source
|
446
446
|
end
|
447
447
|
|
448
|
-
# Convert node to a hash, so that it can be converted to a json.
|
449
|
-
def to_hash
|
450
|
-
result = { node_type: type }
|
451
|
-
if TYPE_CHILDREN[type]
|
452
|
-
TYPE_CHILDREN[type].each do |key|
|
453
|
-
value = send(key)
|
454
|
-
result[key] =
|
455
|
-
case value
|
456
|
-
when Array
|
457
|
-
value.map { |v| v.respond_to?(:to_hash) ? v.to_hash : v }
|
458
|
-
when Parser::AST::Node
|
459
|
-
value.to_hash
|
460
|
-
else
|
461
|
-
value
|
462
|
-
end
|
463
|
-
end
|
464
|
-
else
|
465
|
-
result[:children] = children.map { |c| c.respond_to?(:to_hash) ? c.to_hash : c }
|
466
|
-
end
|
467
|
-
result
|
468
|
-
end
|
469
|
-
|
470
448
|
# Respond key value and source for hash node, e.g.
|
471
449
|
# @example
|
472
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
|