unparser 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@
3
3
  module Unparser
4
4
  module Writer
5
5
  class Rescue
6
- include Writer, Adamantium::Flat
6
+ include Writer, Adamantium
7
7
 
8
8
  children :body, :rescue_body
9
9
 
@@ -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
@@ -4,7 +4,7 @@ module Unparser
4
4
  module Writer
5
5
  # Writer for send
6
6
  class Send
7
- include Writer, Adamantium::Flat, Constants, Generation
7
+ include Writer, Adamantium, Constants, Generation
8
8
 
9
9
  INDEX_ASSIGN = :'[]='
10
10
  INDEX_REFERENCE = :'[]'
@@ -75,20 +75,7 @@ module Unparser
75
75
  end
76
76
 
77
77
  def emit_normal_arguments
78
- parentheses do
79
- arguments.each_with_index do |node, index|
80
- write(', ') unless index.zero?
81
- emit_argument(node, index.succ.equal?(arguments.length))
82
- end
83
- end
84
- end
85
-
86
- def emit_argument(argument, last)
87
- if n_hash?(argument) && last
88
- writer_with(Emitter::Hash, argument).emit_last_argument_hash
89
- else
90
- visit(argument)
91
- end
78
+ parentheses { delimited(arguments) }
92
79
  end
93
80
 
94
81
  def emit_heredoc_reminder(argument)
@@ -104,7 +91,11 @@ module Unparser
104
91
  end
105
92
 
106
93
  def parses_as_constant?
107
- n_const?(Unparser.parse(selector.to_s))
94
+ test = Unparser.parse_either(selector.to_s).from_right do
95
+ fail InvalidNodeError.new("Invalid selector for send node: #{selector.inspect}", node)
96
+ end
97
+
98
+ n_const?(test)
108
99
  end
109
100
 
110
101
  def details
metadata CHANGED
@@ -1,71 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
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-10-18 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: abstract_type
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 0.0.7
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 0.0.7
27
- - !ruby/object:Gem::Dependency
28
- name: adamantium
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.2.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.2.0
41
- - !ruby/object:Gem::Dependency
42
- name: anima
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 0.3.1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 0.3.1
55
- - !ruby/object:Gem::Dependency
56
- name: concord
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.1.5
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.1.5
69
13
  - !ruby/object:Gem::Dependency
70
14
  name: diff-lcs
71
15
  requirement: !ruby/object:Gem::Requirement
@@ -80,90 +24,48 @@ dependencies:
80
24
  - - "~>"
81
25
  - !ruby/object:Gem::Version
82
26
  version: '1.3'
83
- - !ruby/object:Gem::Dependency
84
- name: equalizer
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.0.9
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.0.9
97
- - !ruby/object:Gem::Dependency
98
- name: mprelude
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.1.0
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.1.0
111
27
  - !ruby/object:Gem::Dependency
112
28
  name: parser
113
29
  requirement: !ruby/object:Gem::Requirement
114
30
  requirements:
115
31
  - - ">="
116
32
  - !ruby/object:Gem::Version
117
- version: 2.6.5
33
+ version: 3.0.0
118
34
  type: :runtime
119
35
  prerelease: false
120
36
  version_requirements: !ruby/object:Gem::Requirement
121
37
  requirements:
122
38
  - - ">="
123
39
  - !ruby/object:Gem::Version
124
- version: 2.6.5
125
- - !ruby/object:Gem::Dependency
126
- name: procto
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.0.2
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.0.2
40
+ version: 3.0.0
139
41
  - !ruby/object:Gem::Dependency
140
42
  name: mutant
141
43
  requirement: !ruby/object:Gem::Requirement
142
44
  requirements:
143
45
  - - "~>"
144
46
  - !ruby/object:Gem::Version
145
- version: 0.9.14
47
+ version: 0.10.25
146
48
  type: :development
147
49
  prerelease: false
148
50
  version_requirements: !ruby/object:Gem::Requirement
149
51
  requirements:
150
52
  - - "~>"
151
53
  - !ruby/object:Gem::Version
152
- version: 0.9.14
54
+ version: 0.10.25
153
55
  - !ruby/object:Gem::Dependency
154
56
  name: mutant-rspec
155
57
  requirement: !ruby/object:Gem::Requirement
156
58
  requirements:
157
59
  - - "~>"
158
60
  - !ruby/object:Gem::Version
159
- version: 0.9.14
61
+ version: 0.10.25
160
62
  type: :development
161
63
  prerelease: false
162
64
  version_requirements: !ruby/object:Gem::Requirement
163
65
  requirements:
164
66
  - - "~>"
165
67
  - !ruby/object:Gem::Version
166
- version: 0.9.14
68
+ version: 0.10.25
167
69
  - !ruby/object:Gem::Dependency
168
70
  name: rspec
169
71
  requirement: !ruby/object:Gem::Requirement
@@ -198,42 +100,42 @@ dependencies:
198
100
  requirements:
199
101
  - - "~>"
200
102
  - !ruby/object:Gem::Version
201
- version: 1.2.0
103
+ version: 1.3.0
202
104
  type: :development
203
105
  prerelease: false
204
106
  version_requirements: !ruby/object:Gem::Requirement
205
107
  requirements:
206
108
  - - "~>"
207
109
  - !ruby/object:Gem::Version
208
- version: 1.2.0
110
+ version: 1.3.0
209
111
  - !ruby/object:Gem::Dependency
210
112
  name: rubocop
211
113
  requirement: !ruby/object:Gem::Requirement
212
114
  requirements:
213
115
  - - "~>"
214
116
  - !ruby/object:Gem::Version
215
- version: 0.92.0
117
+ version: '1.7'
216
118
  type: :development
217
119
  prerelease: false
218
120
  version_requirements: !ruby/object:Gem::Requirement
219
121
  requirements:
220
122
  - - "~>"
221
123
  - !ruby/object:Gem::Version
222
- version: 0.92.0
124
+ version: '1.7'
223
125
  - !ruby/object:Gem::Dependency
224
126
  name: rubocop-packaging
225
127
  requirement: !ruby/object:Gem::Requirement
226
128
  requirements:
227
129
  - - "~>"
228
130
  - !ruby/object:Gem::Version
229
- version: 0.5.0
131
+ version: '0.5'
230
132
  type: :development
231
133
  prerelease: false
232
134
  version_requirements: !ruby/object:Gem::Requirement
233
135
  requirements:
234
136
  - - "~>"
235
137
  - !ruby/object:Gem::Version
236
- version: 0.5.0
138
+ version: '0.5'
237
139
  description: Generate equivalent source for parser gem AST nodes
238
140
  email: mbj@schirp-dso.com
239
141
  executables:
@@ -245,15 +147,23 @@ files:
245
147
  - README.md
246
148
  - bin/unparser
247
149
  - lib/unparser.rb
150
+ - lib/unparser/abstract_type.rb
151
+ - lib/unparser/adamantium.rb
152
+ - lib/unparser/adamantium/method_builder.rb
153
+ - lib/unparser/anima.rb
154
+ - lib/unparser/anima/attribute.rb
155
+ - lib/unparser/anima/error.rb
248
156
  - lib/unparser/ast.rb
249
157
  - lib/unparser/ast/local_variable_scope.rb
250
158
  - lib/unparser/buffer.rb
251
159
  - lib/unparser/cli.rb
252
160
  - lib/unparser/color.rb
253
161
  - lib/unparser/comments.rb
162
+ - lib/unparser/concord.rb
254
163
  - lib/unparser/constants.rb
255
164
  - lib/unparser/diff.rb
256
165
  - lib/unparser/dsl.rb
166
+ - lib/unparser/either.rb
257
167
  - lib/unparser/emitter.rb
258
168
  - lib/unparser/emitter/alias.rb
259
169
  - lib/unparser/emitter/args.rb
@@ -285,17 +195,20 @@ files:
285
195
  - lib/unparser/emitter/in_match.rb
286
196
  - lib/unparser/emitter/in_pattern.rb
287
197
  - lib/unparser/emitter/index.rb
198
+ - lib/unparser/emitter/kwargs.rb
288
199
  - lib/unparser/emitter/kwbegin.rb
289
200
  - lib/unparser/emitter/lambda.rb
290
201
  - lib/unparser/emitter/masgn.rb
291
202
  - lib/unparser/emitter/match.rb
292
203
  - lib/unparser/emitter/match_alt.rb
293
204
  - lib/unparser/emitter/match_as.rb
205
+ - lib/unparser/emitter/match_pattern.rb
294
206
  - lib/unparser/emitter/match_rest.rb
295
207
  - lib/unparser/emitter/match_var.rb
296
208
  - lib/unparser/emitter/mlhs.rb
297
209
  - lib/unparser/emitter/module.rb
298
210
  - lib/unparser/emitter/op_assign.rb
211
+ - lib/unparser/emitter/pair.rb
299
212
  - lib/unparser/emitter/pin.rb
300
213
  - lib/unparser/emitter/primitive.rb
301
214
  - lib/unparser/emitter/range.rb
@@ -311,6 +224,7 @@ files:
311
224
  - lib/unparser/emitter/variable.rb
312
225
  - lib/unparser/emitter/xstr.rb
313
226
  - lib/unparser/emitter/yield.rb
227
+ - lib/unparser/equalizer.rb
314
228
  - lib/unparser/finalize.rb
315
229
  - lib/unparser/generation.rb
316
230
  - lib/unparser/node_details.rb
@@ -331,7 +245,10 @@ files:
331
245
  homepage: http://github.com/mbj/unparser
332
246
  licenses:
333
247
  - MIT
334
- metadata: {}
248
+ metadata:
249
+ bug_tracker_uri: https://github.com/mbj/unparser/issues
250
+ changelog_uri: https://github.com/mbj/unparser/blob/master/Changelog.md
251
+ funding_uri: https://github.com/sponsors/mbj
335
252
  post_install_message:
336
253
  rdoc_options: []
337
254
  require_paths:
@@ -347,7 +264,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
264
  - !ruby/object:Gem::Version
348
265
  version: '0'
349
266
  requirements: []
350
- rubygems_version: 3.1.4
267
+ rubyforge_project:
268
+ rubygems_version: 2.7.6.2
351
269
  signing_key:
352
270
  specification_version: 4
353
271
  summary: Generate equivalent source for parser gem AST nodes