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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/static_literal_parser.rb +5 -2
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12ae33173996d6d6a8ca83c11ad33e985bc323c193a4774e6985b39877007e35
4
- data.tar.gz: c9c2201c0ca3c7527693108e05797013e6742cea5a2ac22ca5b9126c082b90dd
3
+ metadata.gz: aff6dfa8f8fcafdc338c2b9e50ecebb74b48c1fcd594bde02d7509125a798eac
4
+ data.tar.gz: d43b05bf656f8fe253da12381d15b7e0f5c69e29b674c3641dca8e6acac64a36
5
5
  SHA512:
6
- metadata.gz: e53a3748ac894be86a680d1db09e65220cbfa5cc7577265929bc024487092f54849e7f60caf775a013cb5cb93650ab1bde876aa729971e1e289b6c0f0211225e
7
- data.tar.gz: 04f9828734feb07f82f906ff8e31f2a2cbfb66c11878ac13a28eca886b891a91b3859a2480736d5bb1f3f3b8b90ba2fc6e332d297083839599a9811a6eedebf2
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[node.children[0]] or raise "Missing const: #{node.children[0]}"
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
- constants[:"#{parent}::#{child}"] or raise "Missing nested const: #{[parent, child]}"
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.0
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: 2020-11-01 00:00:00.000000000 Z
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: '0'
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: 3.6.2
40
+ rubygems_version: 4.0.3
41
41
  specification_version: 4
42
42
  summary: StaticLiteralParser.parse(str, constants)
43
43
  test_files: []