static_literal_parser 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/static_literal_parser.rb +6 -1
- metadata +2 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12ae33173996d6d6a8ca83c11ad33e985bc323c193a4774e6985b39877007e35
|
4
|
+
data.tar.gz: c9c2201c0ca3c7527693108e05797013e6742cea5a2ac22ca5b9126c082b90dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e53a3748ac894be86a680d1db09e65220cbfa5cc7577265929bc024487092f54849e7f60caf775a013cb5cb93650ab1bde876aa729971e1e289b6c0f0211225e
|
7
|
+
data.tar.gz: 04f9828734feb07f82f906ff8e31f2a2cbfb66c11878ac13a28eca886b891a91b3859a2480736d5bb1f3f3b8b90ba2fc6e332d297083839599a9811a6eedebf2
|
@@ -13,6 +13,7 @@ module StaticLiteralParser
|
|
13
13
|
end
|
14
14
|
|
15
15
|
private_class_method def self.parse_(node, constants)
|
16
|
+
return unless node
|
16
17
|
case node.type
|
17
18
|
when :SCOPE
|
18
19
|
parse_(node.children[2], constants)
|
@@ -20,8 +21,12 @@ module StaticLiteralParser
|
|
20
21
|
node.children[0..-2].map {|x| parse_(x, constants) }
|
21
22
|
when :HASH
|
22
23
|
Hash[*parse_(node.children[0], constants)]
|
23
|
-
when :
|
24
|
+
when :INTEGER, :FLOAT, :SYM, :IMAGINARY, :RATIONAL, :STR, :REGX, :NIL
|
24
25
|
node.children[0]
|
26
|
+
when :TRUE
|
27
|
+
true
|
28
|
+
when :FALSE
|
29
|
+
false
|
25
30
|
when :CONST
|
26
31
|
constants[node.children[0]] or raise "Missing const: #{node.children[0]}"
|
27
32
|
when :COLON2
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_literal_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuhiro Ujihisa
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
10
|
date: 2020-11-01 00:00:00.000000000 Z
|
@@ -24,7 +23,6 @@ homepage: https://github.com/ujihisa/static_literal_parser
|
|
24
23
|
licenses:
|
25
24
|
- GPL-3.0-or-later
|
26
25
|
metadata: {}
|
27
|
-
post_install_message:
|
28
26
|
rdoc_options: []
|
29
27
|
require_paths:
|
30
28
|
- lib
|
@@ -39,8 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
37
|
- !ruby/object:Gem::Version
|
40
38
|
version: '0'
|
41
39
|
requirements: []
|
42
|
-
rubygems_version: 3.
|
43
|
-
signing_key:
|
40
|
+
rubygems_version: 3.6.2
|
44
41
|
specification_version: 4
|
45
42
|
summary: StaticLiteralParser.parse(str, constants)
|
46
43
|
test_files: []
|