static_literal_parser 1.2.0 → 1.3.1
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 +8 -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: 92355876f3c25d3bbadaeda45c9db6839fd10cc51f80282f24f25f8894ed3638
|
4
|
+
data.tar.gz: ce5057a81dc89744fcb9b4467e61e0a4e0a1eb550a6061f1f44f3ce461679bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd4350e8a9a5844d0dd5712d8ed4cca8fd7bd13807d8f85b5fd7fe064261a3c6b54ac512cfa88d72327705369980e54d338187236d679a7409992260435fb14e
|
7
|
+
data.tar.gz: 5b64848177296a3b1f24145c9d973a7c52703d7e079144545cd2e9ae7953ccd3790c9a924ce1861e13dd33ef411cba5ba402def631d66cf8861dadafe45d89c7
|
@@ -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,14 @@ 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 :LIT
|
24
|
+
when :LIT # Old name for Ruby 3.3 or older. As well as STR and NIL
|
24
25
|
node.children[0]
|
26
|
+
when :INTEGER, :FLOAT, :SYM, :IMAGINARY, :RATIONAL, :STR, :REGX, :NIL
|
27
|
+
node.children[0]
|
28
|
+
when :TRUE
|
29
|
+
true
|
30
|
+
when :FALSE
|
31
|
+
false
|
25
32
|
when :CONST
|
26
33
|
constants[node.children[0]] or raise "Missing const: #{node.children[0]}"
|
27
34
|
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.1
|
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: []
|