unparser 0.6.12 → 0.6.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 238250e76ff58e37c5b4244ab7405049b41f561bca57fb25f96dbc94b60912fe
4
- data.tar.gz: f65992f16196488d06ed58bb419de2fe5201152e13af5338df2d3ca5194a74ba
3
+ metadata.gz: aa5ab956c61e189d5b428bae04f56316c68498470e62768beca73dbf964cd5ac
4
+ data.tar.gz: b6e097050d79ffbab0687a72eba3834189506269ef92dee80e71a4a58741386d
5
5
  SHA512:
6
- metadata.gz: ee110d72b0d04851cf9d6131c1d20072a5ca37bfbf83a48c21a4044d9404370191fd801e02af615f90459c5afab4b67d83df5cbbc1de9ec44456d7272cc44e61
7
- data.tar.gz: ee6b0324cde01ad9d60b3a2233f3213e1c2f01ce0cd61b1dc029281cc650a1659403174c2ddb449d488e84b632bf7554f7d5eb7183f05682407690eabcc5c92f
6
+ metadata.gz: 284e039b588767beb2e3fb505ad61c6e121f667b96c4afa6ef0aef0efe31c0d06bdb5269a73614eda79600eb02cc963122b74e53e3fffb7a26cdcae95ae1d666
7
+ data.tar.gz: d77901e08acf36a10ccd00a3474662019fe84b8188ac1b39b40f3312b0b6dcb1c6f609ccd87b4d26808a0f9544425cf6d44ab456af01ff712c9c882150c4ff38
@@ -10,7 +10,7 @@ module Unparser
10
10
  # Emitter for primitives based on Object#inspect
11
11
  class Inspect < self
12
12
 
13
- handle :sym, :str
13
+ handle :str
14
14
 
15
15
  private
16
16
 
@@ -20,6 +20,32 @@ module Unparser
20
20
 
21
21
  end # Inspect
22
22
 
23
+ class Symbol < self
24
+
25
+ handle :sym
26
+
27
+ private
28
+
29
+ # mutant:disable
30
+ def dispatch
31
+ if inspect_breaks_parsing?
32
+ write(":#{value.name.inspect}")
33
+ else
34
+ write(value.inspect)
35
+ end
36
+ end
37
+
38
+ # mutant:disable
39
+ def inspect_breaks_parsing?
40
+ return false unless RUBY_VERSION < '3.2.'
41
+
42
+ Unparser.parse(value.inspect)
43
+ false
44
+ rescue Parser::SyntaxError
45
+ true
46
+ end
47
+ end # Symbol
48
+
23
49
  # Emitter for complex literals
24
50
  class Complex < self
25
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.12
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.2.4
33
+ version: 3.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.2.4
40
+ version: 3.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mutant
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.11.22
47
+ version: 0.11.27
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.11.22
54
+ version: 0.11.27
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mutant-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.11.22
61
+ version: 0.11.27
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.11.22
68
+ version: 0.11.27
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubygems_version: 3.4.10
270
+ rubygems_version: 3.3.26
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: Generate equivalent source for parser gem AST nodes