unparser 0.4.8 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -5
  3. data/bin/unparser +1 -1
  4. data/lib/unparser.rb +115 -61
  5. data/lib/unparser/ast.rb +0 -1
  6. data/lib/unparser/ast/local_variable_scope.rb +6 -76
  7. data/lib/unparser/buffer.rb +19 -16
  8. data/lib/unparser/cli.rb +26 -39
  9. data/lib/unparser/color.rb +0 -3
  10. data/lib/unparser/comments.rb +0 -26
  11. data/lib/unparser/constants.rb +4 -53
  12. data/lib/unparser/diff.rb +0 -17
  13. data/lib/unparser/dsl.rb +0 -32
  14. data/lib/unparser/emitter.rb +23 -425
  15. data/lib/unparser/emitter/alias.rb +2 -8
  16. data/lib/unparser/emitter/args.rb +45 -0
  17. data/lib/unparser/emitter/argument.rb +8 -166
  18. data/lib/unparser/emitter/array.rb +27 -0
  19. data/lib/unparser/emitter/array_pattern.rb +29 -0
  20. data/lib/unparser/emitter/assignment.rb +36 -127
  21. data/lib/unparser/emitter/begin.rb +9 -84
  22. data/lib/unparser/emitter/binary.rb +7 -20
  23. data/lib/unparser/emitter/block.rb +57 -41
  24. data/lib/unparser/emitter/case.rb +6 -48
  25. data/lib/unparser/emitter/case_guard.rb +27 -0
  26. data/lib/unparser/emitter/case_match.rb +40 -0
  27. data/lib/unparser/emitter/cbase.rb +1 -3
  28. data/lib/unparser/emitter/class.rb +6 -26
  29. data/lib/unparser/emitter/const_pattern.rb +24 -0
  30. data/lib/unparser/emitter/def.rb +7 -51
  31. data/lib/unparser/emitter/defined.rb +2 -12
  32. data/lib/unparser/emitter/dstr.rb +22 -0
  33. data/lib/unparser/emitter/dsym.rb +41 -0
  34. data/lib/unparser/emitter/flipflop.rb +11 -10
  35. data/lib/unparser/emitter/float.rb +29 -0
  36. data/lib/unparser/emitter/flow_modifier.rb +8 -55
  37. data/lib/unparser/emitter/for.rb +5 -19
  38. data/lib/unparser/emitter/hash.rb +74 -0
  39. data/lib/unparser/emitter/hash_pattern.rb +67 -0
  40. data/lib/unparser/emitter/hookexe.rb +5 -11
  41. data/lib/unparser/emitter/if.rb +9 -73
  42. data/lib/unparser/emitter/in_match.rb +21 -0
  43. data/lib/unparser/emitter/in_pattern.rb +34 -0
  44. data/lib/unparser/emitter/index.rb +21 -88
  45. data/lib/unparser/emitter/kwbegin.rb +31 -0
  46. data/lib/unparser/emitter/lambda.rb +0 -8
  47. data/lib/unparser/emitter/masgn.rb +20 -0
  48. data/lib/unparser/emitter/match.rb +3 -17
  49. data/lib/unparser/emitter/match_alt.rb +23 -0
  50. data/lib/unparser/emitter/match_as.rb +21 -0
  51. data/lib/unparser/emitter/match_rest.rb +26 -0
  52. data/lib/unparser/emitter/match_var.rb +19 -0
  53. data/lib/unparser/emitter/mlhs.rb +40 -0
  54. data/lib/unparser/emitter/module.rb +3 -9
  55. data/lib/unparser/emitter/op_assign.rb +12 -27
  56. data/lib/unparser/emitter/pin.rb +19 -0
  57. data/lib/unparser/emitter/primitive.rb +93 -0
  58. data/lib/unparser/emitter/range.rb +35 -0
  59. data/lib/unparser/emitter/regexp.rb +35 -0
  60. data/lib/unparser/emitter/repetition.rb +17 -57
  61. data/lib/unparser/emitter/rescue.rb +1 -97
  62. data/lib/unparser/emitter/root.rb +17 -1
  63. data/lib/unparser/emitter/send.rb +10 -219
  64. data/lib/unparser/emitter/simple.rb +33 -0
  65. data/lib/unparser/emitter/splat.rb +2 -18
  66. data/lib/unparser/emitter/super.rb +1 -29
  67. data/lib/unparser/emitter/undef.rb +1 -9
  68. data/lib/unparser/emitter/variable.rb +1 -31
  69. data/lib/unparser/emitter/xstr.rb +72 -0
  70. data/lib/unparser/emitter/yield.rb +1 -9
  71. data/lib/unparser/generation.rb +250 -0
  72. data/lib/unparser/node_details.rb +21 -0
  73. data/lib/unparser/node_details/send.rb +62 -0
  74. data/lib/unparser/node_helpers.rb +45 -6
  75. data/lib/unparser/validation.rb +58 -35
  76. data/lib/unparser/writer.rb +15 -0
  77. data/lib/unparser/writer/binary.rb +99 -0
  78. data/lib/unparser/writer/dynamic_string.rb +233 -0
  79. data/lib/unparser/writer/resbody.rb +40 -0
  80. data/lib/unparser/writer/rescue.rb +39 -0
  81. data/lib/unparser/writer/send.rb +124 -0
  82. data/lib/unparser/{emitter → writer}/send/attribute_assignment.rb +11 -26
  83. data/lib/unparser/writer/send/binary.rb +27 -0
  84. data/lib/unparser/writer/send/conditional.rb +25 -0
  85. data/lib/unparser/writer/send/regular.rb +33 -0
  86. data/lib/unparser/{emitter → writer}/send/unary.rb +10 -17
  87. metadata +65 -89
  88. data/.github/workflows/ci.yml +0 -90
  89. data/.gitignore +0 -37
  90. data/.rspec +0 -4
  91. data/.rubocop.yml +0 -126
  92. data/Changelog.md +0 -162
  93. data/Gemfile +0 -9
  94. data/Gemfile.lock +0 -111
  95. data/LICENSE +0 -20
  96. data/Rakefile +0 -22
  97. data/config/devtools.yml +0 -2
  98. data/config/flay.yml +0 -3
  99. data/config/flog.yml +0 -2
  100. data/config/mutant.yml +0 -6
  101. data/config/reek.yml +0 -98
  102. data/config/yardstick.yml +0 -2
  103. data/lib/unparser/emitter/empty.rb +0 -23
  104. data/lib/unparser/emitter/ensure.rb +0 -37
  105. data/lib/unparser/emitter/literal.rb +0 -10
  106. data/lib/unparser/emitter/literal/array.rb +0 -29
  107. data/lib/unparser/emitter/literal/dynamic.rb +0 -53
  108. data/lib/unparser/emitter/literal/dynamic_body.rb +0 -132
  109. data/lib/unparser/emitter/literal/execute_string.rb +0 -38
  110. data/lib/unparser/emitter/literal/hash.rb +0 -156
  111. data/lib/unparser/emitter/literal/primitive.rb +0 -145
  112. data/lib/unparser/emitter/literal/range.rb +0 -36
  113. data/lib/unparser/emitter/literal/regexp.rb +0 -114
  114. data/lib/unparser/emitter/literal/singleton.rb +0 -26
  115. data/lib/unparser/emitter/meta.rb +0 -16
  116. data/lib/unparser/emitter/redo.rb +0 -25
  117. data/lib/unparser/emitter/resbody.rb +0 -76
  118. data/lib/unparser/emitter/retry.rb +0 -25
  119. data/lib/unparser/emitter/send/binary.rb +0 -57
  120. data/lib/unparser/emitter/send/conditional.rb +0 -40
  121. data/lib/unparser/emitter/send/regular.rb +0 -40
  122. data/lib/unparser/preprocessor.rb +0 -159
  123. data/spec/integration/unparser/corpus_spec.rb +0 -125
  124. data/spec/integrations.yml +0 -92
  125. data/spec/spec_helper.rb +0 -42
  126. data/spec/unit/unparser/buffer/append_spec.rb +0 -24
  127. data/spec/unit/unparser/buffer/append_without_prefix_spec.rb +0 -23
  128. data/spec/unit/unparser/buffer/capture_content_spec.rb +0 -17
  129. data/spec/unit/unparser/buffer/content_spec.rb +0 -38
  130. data/spec/unit/unparser/buffer/fresh_line_spec.rb +0 -20
  131. data/spec/unit/unparser/buffer/indent_spec.rb +0 -20
  132. data/spec/unit/unparser/buffer/nl_spec.rb +0 -16
  133. data/spec/unit/unparser/buffer/unindent_spec.rb +0 -20
  134. data/spec/unit/unparser/color_spec.rb +0 -40
  135. data/spec/unit/unparser/comments/consume_spec.rb +0 -22
  136. data/spec/unit/unparser/comments/take_all_spec.rb +0 -19
  137. data/spec/unit/unparser/comments/take_before_spec.rb +0 -46
  138. data/spec/unit/unparser/comments/take_eol_comments_spec.rb +0 -32
  139. data/spec/unit/unparser/diff_spec.rb +0 -189
  140. data/spec/unit/unparser/emitter/class_methods/handle_spec.rb +0 -17
  141. data/spec/unit/unparser/validation_spec.rb +0 -327
  142. data/spec/unit/unparser_spec.rb +0 -1920
  143. data/unparser.gemspec +0 -35
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ # Writer for rescue bodies
6
+ class Resbody
7
+ include Writer
8
+
9
+ children :exception, :assignment, :body
10
+
11
+ def emit_postcontrol
12
+ write(' rescue ')
13
+ visit(body)
14
+ end
15
+
16
+ def emit_regular
17
+ write('rescue')
18
+ emit_exception
19
+ emit_assignment
20
+ emit_optional_body(body)
21
+ end
22
+
23
+ private
24
+
25
+ def emit_exception
26
+ return unless exception
27
+
28
+ ws
29
+ delimited(exception.children)
30
+ end
31
+
32
+ def emit_assignment
33
+ return unless assignment
34
+
35
+ write(' => ')
36
+ visit(assignment)
37
+ end
38
+ end # Resbody
39
+ end # Writer
40
+ end # Unparser
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ class Rescue
6
+ include Writer, Adamantium::Flat
7
+
8
+ children :body, :rescue_body
9
+
10
+ define_group :rescue_bodies, 1..-2
11
+
12
+ def emit_regular
13
+ emit_optional_body(body)
14
+
15
+ rescue_bodies.each(&method(:emit_rescue_body))
16
+
17
+ if else_node
18
+ write('else')
19
+ emit_body(else_node)
20
+ end
21
+ end
22
+
23
+ def emit_postcontrol
24
+ visit(body)
25
+ writer_with(Resbody, rescue_body).emit_postcontrol
26
+ end
27
+
28
+ private
29
+
30
+ def else_node
31
+ children.last
32
+ end
33
+
34
+ def emit_rescue_body(node)
35
+ writer_with(Resbody, node).emit_regular
36
+ end
37
+ end # Rescue
38
+ end # Writer
39
+ end # Unparser
@@ -0,0 +1,124 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ # Writer for send
6
+ class Send
7
+ include Writer, Adamantium::Flat, Constants, Generation
8
+
9
+ INDEX_ASSIGN = :'[]='
10
+ INDEX_REFERENCE = :'[]'
11
+
12
+ OPERATORS = {
13
+ csend: '&.',
14
+ send: '.'
15
+ }.freeze
16
+
17
+ private_constant(*constants(false))
18
+
19
+ children :receiver, :selector
20
+
21
+ def dispatch
22
+ effective_writer.dispatch
23
+ end
24
+
25
+ def emit_mlhs
26
+ effective_writer.emit_send_mlhs
27
+ end
28
+
29
+ def emit_selector
30
+ write(details.string_selector)
31
+ end
32
+
33
+ def emit_heredoc_reminders
34
+ emitter(receiver).emit_heredoc_reminders if receiver
35
+ arguments.each(&method(:emit_heredoc_reminder))
36
+ end
37
+
38
+ private
39
+
40
+ def effective_writer
41
+ writer_with(effective_writer_class, node)
42
+ end
43
+ memoize :effective_writer
44
+
45
+ def effective_writer_class
46
+ if details.binary_syntax_allowed?
47
+ Binary
48
+ elsif details.selector_unary_operator? && n_send?(node)
49
+ Unary
50
+ elsif write_as_attribute_assignment?
51
+ AttributeAssignment
52
+ else
53
+ Regular
54
+ end
55
+ end
56
+
57
+ def write_as_attribute_assignment?
58
+ details.assignment_operator?
59
+ end
60
+
61
+ def emit_operator
62
+ write(OPERATORS.fetch(node.type))
63
+ end
64
+
65
+ def emit_arguments
66
+ if arguments.empty?
67
+ write('()') if receiver.nil? && avoid_clash?
68
+ else
69
+ emit_normal_arguments
70
+ end
71
+ end
72
+
73
+ def arguments
74
+ details.arguments
75
+ end
76
+
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
92
+ end
93
+
94
+ def emit_heredoc_reminder(argument)
95
+ emitter(argument).emit_heredoc_reminders
96
+ end
97
+
98
+ def avoid_clash?
99
+ local_variable_clash? || parses_as_constant?
100
+ end
101
+
102
+ def local_variable_clash?
103
+ local_variable_scope.local_variable_defined_for_node?(node, selector)
104
+ end
105
+
106
+ def parses_as_constant?
107
+ n_const?(Unparser.parse(selector.to_s))
108
+ end
109
+
110
+ def details
111
+ NodeDetails::Send.new(node)
112
+ end
113
+ memoize :details
114
+
115
+ def emit_send_regular(node)
116
+ if n_send?(node)
117
+ writer_with(Regular, node).dispatch
118
+ else
119
+ visit(node)
120
+ end
121
+ end
122
+ end # Send
123
+ end # Writer
124
+ end # Unparser
@@ -1,24 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Unparser
4
- class Emitter
4
+ module Writer
5
5
  class Send
6
- # Emitter for send as attribute assignment
6
+ # Writer for send as attribute assignment
7
7
  class AttributeAssignment < self
8
- include Unterminated
9
-
10
8
  children :receiver, :selector, :first_argument
11
9
 
12
- # Perform regular dispatch
13
- #
14
- # @return [undefined]
15
- #
16
- # @api private
17
- #
18
10
  def dispatch
19
11
  emit_receiver
20
12
  emit_attribute
21
- write(T_ASN)
13
+ write('=')
22
14
 
23
15
  if arguments.one?
24
16
  visit(first_argument)
@@ -27,29 +19,22 @@ module Unparser
27
19
  end
28
20
  end
29
21
 
22
+ def emit_send_mlhs
23
+ emit_receiver
24
+ write(details.non_assignment_selector)
25
+ end
26
+
30
27
  private
31
28
 
32
- # Emit receiver
33
- #
34
- # @return [Parser::AST::Node]
35
- #
36
- # @api private
37
- #
38
29
  def emit_receiver
39
30
  visit(receiver)
40
- write(T_DOT)
31
+ emit_operator
41
32
  end
42
33
 
43
- # Emit attribute
44
- #
45
- # @return [undefined]
46
- #
47
- # @api private
48
- #
49
34
  def emit_attribute
50
- write(non_assignment_selector)
35
+ write(details.non_assignment_selector)
51
36
  end
52
37
  end # AttributeAssignment
53
38
  end # Send
54
- end # Emitter
39
+ end # Writer
55
40
  end # Unparser
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ class Send
6
+ # Writer for binary sends
7
+ class Binary < self
8
+ def dispatch
9
+ visit(receiver)
10
+ emit_operator
11
+ emit_right
12
+ end
13
+
14
+ private
15
+
16
+ def emit_operator
17
+ write(' ', details.string_selector, ' ')
18
+ end
19
+
20
+ def emit_right
21
+ emit_send_regular(children.fetch(2))
22
+ end
23
+
24
+ end # Binary
25
+ end # Send
26
+ end # Writer
27
+ end # Unparser
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ class Send
6
+ # Writer for "conditional" receiver&.selector(arguments...) case
7
+ class Conditional < self
8
+
9
+ private
10
+
11
+ def dispatch
12
+ emit_receiver
13
+ emit_selector
14
+ emit_arguments
15
+ end
16
+
17
+ def emit_receiver
18
+ visit(receiver)
19
+ write('&.')
20
+ end
21
+
22
+ end # Regular
23
+ end # Send
24
+ end # Writer
25
+ end # Unparser
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Unparser
4
+ module Writer
5
+ class Send
6
+ # Writer for "regular" receiver.selector(arguments...) case
7
+ class Regular < self
8
+ def dispatch
9
+ emit_receiver
10
+ emit_selector
11
+ emit_arguments
12
+ end
13
+
14
+ def emit_send_mlhs
15
+ dispatch
16
+ end
17
+
18
+ def emit_arguments_without_heredoc_body
19
+ emit_normal_arguments if arguments.any?
20
+ end
21
+
22
+ def emit_receiver
23
+ return unless receiver
24
+
25
+ emit_send_regular(receiver)
26
+
27
+ emit_operator
28
+ end
29
+
30
+ end # Regular
31
+ end # Send
32
+ end # Writer
33
+ end # Unparser
@@ -1,36 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Unparser
4
- class Emitter
4
+ module Writer
5
5
  class Send
6
- # Emitter for unary sends
6
+ # Writer for unary sends
7
7
  class Unary < self
8
- include Unterminated
9
-
10
- private
11
-
12
- MAP = IceNine.deep_freeze(
8
+ MAP = {
13
9
  '-@': '-',
14
10
  '+@': '+'
15
- )
11
+ }.freeze
12
+
13
+ private_constant(*constants(false))
16
14
 
17
- # Perform dispatch
18
- #
19
- # @return [undefined]
20
- #
21
- # @api private
22
- #
23
15
  def dispatch
24
16
  name = selector
17
+
25
18
  write(MAP.fetch(name, name).to_s)
26
- if receiver.type.equal?(:int) && selector.equal?(:'+@')
19
+
20
+ if n_int?(receiver) && selector.equal?(:'+@')
27
21
  write('+')
28
22
  end
29
23
 
30
24
  visit(receiver)
31
25
  end
32
-
33
26
  end # Unary
34
27
  end # Send
35
- end # Emitter
28
+ end # Writer
36
29
  end # Unparser
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.4.8
4
+ version: 0.5.3
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-08-25 00:00:00.000000000 Z
11
+ date: 2020-10-18 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.9.9
145
+ version: 0.9.14
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.9.9
152
+ version: 0.9.14
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.9.9
159
+ version: 0.9.14
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.9.9
166
+ version: 0.9.14
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +212,28 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 0.79.0
215
+ version: 0.92.0
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: 0.79.0
222
+ version: 0.92.0
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop-packaging
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: 0.5.0
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: 0.5.0
223
237
  description: Generate equivalent source for parser gem AST nodes
224
238
  email: mbj@schirp-dso.com
225
239
  executables:
@@ -228,23 +242,8 @@ extensions: []
228
242
  extra_rdoc_files:
229
243
  - README.md
230
244
  files:
231
- - ".github/workflows/ci.yml"
232
- - ".gitignore"
233
- - ".rspec"
234
- - ".rubocop.yml"
235
- - Changelog.md
236
- - Gemfile
237
- - Gemfile.lock
238
- - LICENSE
239
245
  - README.md
240
- - Rakefile
241
246
  - bin/unparser
242
- - config/devtools.yml
243
- - config/flay.yml
244
- - config/flog.yml
245
- - config/mutant.yml
246
- - config/reek.yml
247
- - config/yardstick.yml
248
247
  - lib/unparser.rb
249
248
  - lib/unparser/ast.rb
250
249
  - lib/unparser/ast/local_variable_scope.rb
@@ -257,81 +256,78 @@ files:
257
256
  - lib/unparser/dsl.rb
258
257
  - lib/unparser/emitter.rb
259
258
  - lib/unparser/emitter/alias.rb
259
+ - lib/unparser/emitter/args.rb
260
260
  - lib/unparser/emitter/argument.rb
261
+ - lib/unparser/emitter/array.rb
262
+ - lib/unparser/emitter/array_pattern.rb
261
263
  - lib/unparser/emitter/assignment.rb
262
264
  - lib/unparser/emitter/begin.rb
263
265
  - lib/unparser/emitter/binary.rb
264
266
  - lib/unparser/emitter/block.rb
265
267
  - lib/unparser/emitter/case.rb
268
+ - lib/unparser/emitter/case_guard.rb
269
+ - lib/unparser/emitter/case_match.rb
266
270
  - lib/unparser/emitter/cbase.rb
267
271
  - lib/unparser/emitter/class.rb
272
+ - lib/unparser/emitter/const_pattern.rb
268
273
  - lib/unparser/emitter/def.rb
269
274
  - lib/unparser/emitter/defined.rb
270
- - lib/unparser/emitter/empty.rb
271
- - lib/unparser/emitter/ensure.rb
275
+ - lib/unparser/emitter/dstr.rb
276
+ - lib/unparser/emitter/dsym.rb
272
277
  - lib/unparser/emitter/flipflop.rb
278
+ - lib/unparser/emitter/float.rb
273
279
  - lib/unparser/emitter/flow_modifier.rb
274
280
  - lib/unparser/emitter/for.rb
281
+ - lib/unparser/emitter/hash.rb
282
+ - lib/unparser/emitter/hash_pattern.rb
275
283
  - lib/unparser/emitter/hookexe.rb
276
284
  - lib/unparser/emitter/if.rb
285
+ - lib/unparser/emitter/in_match.rb
286
+ - lib/unparser/emitter/in_pattern.rb
277
287
  - lib/unparser/emitter/index.rb
288
+ - lib/unparser/emitter/kwbegin.rb
278
289
  - lib/unparser/emitter/lambda.rb
279
- - lib/unparser/emitter/literal.rb
280
- - lib/unparser/emitter/literal/array.rb
281
- - lib/unparser/emitter/literal/dynamic.rb
282
- - lib/unparser/emitter/literal/dynamic_body.rb
283
- - lib/unparser/emitter/literal/execute_string.rb
284
- - lib/unparser/emitter/literal/hash.rb
285
- - lib/unparser/emitter/literal/primitive.rb
286
- - lib/unparser/emitter/literal/range.rb
287
- - lib/unparser/emitter/literal/regexp.rb
288
- - lib/unparser/emitter/literal/singleton.rb
290
+ - lib/unparser/emitter/masgn.rb
289
291
  - lib/unparser/emitter/match.rb
290
- - lib/unparser/emitter/meta.rb
292
+ - lib/unparser/emitter/match_alt.rb
293
+ - lib/unparser/emitter/match_as.rb
294
+ - lib/unparser/emitter/match_rest.rb
295
+ - lib/unparser/emitter/match_var.rb
296
+ - lib/unparser/emitter/mlhs.rb
291
297
  - lib/unparser/emitter/module.rb
292
298
  - lib/unparser/emitter/op_assign.rb
293
- - lib/unparser/emitter/redo.rb
299
+ - lib/unparser/emitter/pin.rb
300
+ - lib/unparser/emitter/primitive.rb
301
+ - lib/unparser/emitter/range.rb
302
+ - lib/unparser/emitter/regexp.rb
294
303
  - lib/unparser/emitter/repetition.rb
295
- - lib/unparser/emitter/resbody.rb
296
304
  - lib/unparser/emitter/rescue.rb
297
- - lib/unparser/emitter/retry.rb
298
305
  - lib/unparser/emitter/root.rb
299
306
  - lib/unparser/emitter/send.rb
300
- - lib/unparser/emitter/send/attribute_assignment.rb
301
- - lib/unparser/emitter/send/binary.rb
302
- - lib/unparser/emitter/send/conditional.rb
303
- - lib/unparser/emitter/send/regular.rb
304
- - lib/unparser/emitter/send/unary.rb
307
+ - lib/unparser/emitter/simple.rb
305
308
  - lib/unparser/emitter/splat.rb
306
309
  - lib/unparser/emitter/super.rb
307
310
  - lib/unparser/emitter/undef.rb
308
311
  - lib/unparser/emitter/variable.rb
312
+ - lib/unparser/emitter/xstr.rb
309
313
  - lib/unparser/emitter/yield.rb
310
314
  - lib/unparser/finalize.rb
315
+ - lib/unparser/generation.rb
316
+ - lib/unparser/node_details.rb
317
+ - lib/unparser/node_details/send.rb
311
318
  - lib/unparser/node_helpers.rb
312
- - lib/unparser/preprocessor.rb
313
319
  - lib/unparser/validation.rb
314
- - spec/integration/unparser/corpus_spec.rb
315
- - spec/integrations.yml
316
- - spec/spec_helper.rb
317
- - spec/unit/unparser/buffer/append_spec.rb
318
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
319
- - spec/unit/unparser/buffer/capture_content_spec.rb
320
- - spec/unit/unparser/buffer/content_spec.rb
321
- - spec/unit/unparser/buffer/fresh_line_spec.rb
322
- - spec/unit/unparser/buffer/indent_spec.rb
323
- - spec/unit/unparser/buffer/nl_spec.rb
324
- - spec/unit/unparser/buffer/unindent_spec.rb
325
- - spec/unit/unparser/color_spec.rb
326
- - spec/unit/unparser/comments/consume_spec.rb
327
- - spec/unit/unparser/comments/take_all_spec.rb
328
- - spec/unit/unparser/comments/take_before_spec.rb
329
- - spec/unit/unparser/comments/take_eol_comments_spec.rb
330
- - spec/unit/unparser/diff_spec.rb
331
- - spec/unit/unparser/emitter/class_methods/handle_spec.rb
332
- - spec/unit/unparser/validation_spec.rb
333
- - spec/unit/unparser_spec.rb
334
- - unparser.gemspec
320
+ - lib/unparser/writer.rb
321
+ - lib/unparser/writer/binary.rb
322
+ - lib/unparser/writer/dynamic_string.rb
323
+ - lib/unparser/writer/resbody.rb
324
+ - lib/unparser/writer/rescue.rb
325
+ - lib/unparser/writer/send.rb
326
+ - lib/unparser/writer/send/attribute_assignment.rb
327
+ - lib/unparser/writer/send/binary.rb
328
+ - lib/unparser/writer/send/conditional.rb
329
+ - lib/unparser/writer/send/regular.rb
330
+ - lib/unparser/writer/send/unary.rb
335
331
  homepage: http://github.com/mbj/unparser
336
332
  licenses:
337
333
  - MIT
@@ -344,35 +340,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
344
340
  requirements:
345
341
  - - ">="
346
342
  - !ruby/object:Gem::Version
347
- version: '0'
343
+ version: '2.5'
348
344
  required_rubygems_version: !ruby/object:Gem::Requirement
349
345
  requirements:
350
346
  - - ">="
351
347
  - !ruby/object:Gem::Version
352
348
  version: '0'
353
349
  requirements: []
354
- rubygems_version: 3.0.3
350
+ rubygems_version: 3.1.4
355
351
  signing_key:
356
352
  specification_version: 4
357
353
  summary: Generate equivalent source for parser gem AST nodes
358
- test_files:
359
- - spec/integration/unparser/corpus_spec.rb
360
- - spec/integrations.yml
361
- - spec/spec_helper.rb
362
- - spec/unit/unparser/buffer/append_spec.rb
363
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
364
- - spec/unit/unparser/buffer/capture_content_spec.rb
365
- - spec/unit/unparser/buffer/content_spec.rb
366
- - spec/unit/unparser/buffer/fresh_line_spec.rb
367
- - spec/unit/unparser/buffer/indent_spec.rb
368
- - spec/unit/unparser/buffer/nl_spec.rb
369
- - spec/unit/unparser/buffer/unindent_spec.rb
370
- - spec/unit/unparser/color_spec.rb
371
- - spec/unit/unparser/comments/consume_spec.rb
372
- - spec/unit/unparser/comments/take_all_spec.rb
373
- - spec/unit/unparser/comments/take_before_spec.rb
374
- - spec/unit/unparser/comments/take_eol_comments_spec.rb
375
- - spec/unit/unparser/diff_spec.rb
376
- - spec/unit/unparser/emitter/class_methods/handle_spec.rb
377
- - spec/unit/unparser/validation_spec.rb
378
- - spec/unit/unparser_spec.rb
354
+ test_files: []