unparser 0.5.4 → 0.5.5

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: 83c5893dd093e0f106fefd55abad7931fa775001f53a7449389e40afe0640359
4
- data.tar.gz: d4caba221ba0b3dcd5afdff73d0df537c24c56f3219e0896e5f67b92b79f6afc
3
+ metadata.gz: 824d898a010fcf41a3a7d243d3f6c30dc551751fccc8a7d592e73fe6685dab8c
4
+ data.tar.gz: ef5e5fdc7df12831465d4ed15d35da615ff10eafb342d2a32495c42d88c7b415
5
5
  SHA512:
6
- metadata.gz: 7c7feff0af410abca14daa35166d64b95cda39959f5f6424fb2840a8c5f63b630be4aaba9d22018d745adb2578a9ed7ffc538f4d0c3e6b5224f00e8dd6fceca0
7
- data.tar.gz: efd0a71dc4988fcf804eab203a4fbed157629c531135d7cbaf2e4ccf5c26c9b1ea2a694c1eb1c2f451f91cfe91b6420d683ff76da6779adaef1e3d015c8ab51b
6
+ metadata.gz: c902fd66c8d5195ba76c3f53d028112e41e4bff18e62d851e207949ea332d5c1e2a352a2eb478b626a6fee2c4d908303c595c94364c03539bb4aa8a72d53b64d
7
+ data.tar.gz: 647e6ac18916a4e2454cd1c018932da6c464598ac548d84da242d6b8d8b19c06a5ee430d9fa35338e3576bb860ac3acbde3814e6d891259db1506b9004c612cc
@@ -27,6 +27,8 @@ module Unparser
27
27
  ws
28
28
  write('then')
29
29
  emit_body(branch)
30
+ else
31
+ nl
30
32
  end
31
33
  end
32
34
  end # InPattern
@@ -22,12 +22,22 @@ module Unparser
22
22
 
23
23
  children :subject
24
24
 
25
+ def emit_mlhs
26
+ write('*')
27
+ subject_emitter.emit_mlhs if subject
28
+ end
29
+
25
30
  private
26
31
 
27
32
  def dispatch
28
33
  write('*')
29
- visit(subject) if subject
34
+ subject_emitter.write_to_buffer
35
+ end
36
+
37
+ def subject_emitter
38
+ emitter(subject)
30
39
  end
40
+ memoize :subject_emitter
31
41
  end
32
42
  end
33
43
  end # Unparser
@@ -204,7 +204,9 @@ module Unparser
204
204
  end
205
205
 
206
206
  def emit_rescue_postcontrol(node)
207
- writer_with(Writer::Rescue, node).emit_postcontrol
207
+ writer = writer_with(Writer::Rescue, node)
208
+ writer.emit_postcontrol
209
+ writer.emit_heredoc_reminders
208
210
  end
209
211
 
210
212
  def emit_rescue_regular(node)
@@ -20,7 +20,7 @@ module Unparser
20
20
  ]
21
21
  )
22
22
 
23
- FLAT_INTERPOLATION = %i[ivar cvar gvar].to_set.freeze
23
+ FLAT_INTERPOLATION = %i[ivar cvar gvar nth_ref].to_set.freeze
24
24
 
25
25
  private_constant(*constants(false))
26
26
 
@@ -20,6 +20,10 @@ module Unparser
20
20
  end
21
21
  end
22
22
 
23
+ def emit_heredoc_reminders
24
+ emitter(body).emit_heredoc_reminders
25
+ end
26
+
23
27
  def emit_postcontrol
24
28
  visit(body)
25
29
  writer_with(Resbody, rescue_body).emit_postcontrol
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.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-04 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type
@@ -142,28 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.10.0
145
+ version: 0.10.19
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.10.0
152
+ version: 0.10.19
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: mutant-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.10.0
159
+ version: 0.10.19
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.10.0
166
+ version: 0.10.19
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 1.1.0
215
+ version: 1.6.1
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 1.1.0
222
+ version: 1.6.1
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: rubocop-packaging
225
225
  requirement: !ruby/object:Gem::Requirement