static_literal_parser 1.3.0 → 1.3.2
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 +5 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aff6dfa8f8fcafdc338c2b9e50ecebb74b48c1fcd594bde02d7509125a798eac
|
|
4
|
+
data.tar.gz: d43b05bf656f8fe253da12381d15b7e0f5c69e29b674c3641dca8e6acac64a36
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cdc043852e925c1426a8f14301ec3f87fef96611d4272d27a821513300e97a63913f5b5c7ac656fc1b12765849e4d97bf01d4dd2b6afce6cc9ae34eb666b8588
|
|
7
|
+
data.tar.gz: e9e3764e41ead14f31dcecfaea3a9dedbfecccfd6e62686781f29af3c3d09c1de3ee03b1aeac5bda600228040376770f8f98c3be6da34bc5e2f4cc3ca33f7987
|
|
@@ -21,6 +21,8 @@ module StaticLiteralParser
|
|
|
21
21
|
node.children[0..-2].map {|x| parse_(x, constants) }
|
|
22
22
|
when :HASH
|
|
23
23
|
Hash[*parse_(node.children[0], constants)]
|
|
24
|
+
when :LIT # Old name for Ruby 3.3 or older. As well as STR and NIL
|
|
25
|
+
node.children[0]
|
|
24
26
|
when :INTEGER, :FLOAT, :SYM, :IMAGINARY, :RATIONAL, :STR, :REGX, :NIL
|
|
25
27
|
node.children[0]
|
|
26
28
|
when :TRUE
|
|
@@ -28,13 +30,14 @@ module StaticLiteralParser
|
|
|
28
30
|
when :FALSE
|
|
29
31
|
false
|
|
30
32
|
when :CONST
|
|
31
|
-
constants
|
|
33
|
+
constants.fetch(node.children[0]) { raise "Missing const: #{node.children[0]}" }
|
|
32
34
|
when :COLON2
|
|
33
35
|
(parent, child) = node.children
|
|
34
36
|
case parent.type
|
|
35
37
|
when :CONST, :COLON2
|
|
36
38
|
parent = parse_(parent, constants)
|
|
37
|
-
|
|
39
|
+
name = :"#{parent}::#{child}"
|
|
40
|
+
constants.fetch(name) { raise "Missing nested const: #{[parent, child]}" }
|
|
38
41
|
else
|
|
39
42
|
raise "Unexpected COLON2 parent #{parent.type}"
|
|
40
43
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: static_literal_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tatsuhiro Ujihisa
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-11-11 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: StaticLiteralParser is a RubyGems library that you can convert a String
|
|
13
13
|
to a Ruby object, parsing the string as an executable Ruby code, but without actually
|
|
@@ -30,14 +30,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 2.6.6
|
|
34
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
|
36
36
|
- - ">="
|
|
37
37
|
- !ruby/object:Gem::Version
|
|
38
38
|
version: '0'
|
|
39
39
|
requirements: []
|
|
40
|
-
rubygems_version:
|
|
40
|
+
rubygems_version: 4.0.3
|
|
41
41
|
specification_version: 4
|
|
42
42
|
summary: StaticLiteralParser.parse(str, constants)
|
|
43
43
|
test_files: []
|