unparser 0.4.7 → 0.5.2

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 +1 -2
  3. data/bin/unparser +1 -1
  4. data/lib/unparser.rb +134 -62
  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 +84 -77
  9. data/lib/unparser/{cli/color.rb → color.rb} +0 -13
  10. data/lib/unparser/comments.rb +0 -26
  11. data/lib/unparser/constants.rb +4 -53
  12. data/lib/unparser/diff.rb +98 -0
  13. data/lib/unparser/dsl.rb +0 -32
  14. data/lib/unparser/emitter.rb +24 -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 +172 -0
  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 +127 -104
  88. data/.circleci/config.yml +0 -49
  89. data/.gitignore +0 -37
  90. data/.rspec +0 -4
  91. data/.rubocop.yml +0 -9
  92. data/Changelog.md +0 -156
  93. data/Gemfile +0 -9
  94. data/Gemfile.lock +0 -181
  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/rubocop.yml +0 -122
  103. data/config/yardstick.yml +0 -2
  104. data/lib/unparser/cli/differ.rb +0 -152
  105. data/lib/unparser/cli/source.rb +0 -267
  106. data/lib/unparser/emitter/empty.rb +0 -23
  107. data/lib/unparser/emitter/ensure.rb +0 -37
  108. data/lib/unparser/emitter/literal.rb +0 -10
  109. data/lib/unparser/emitter/literal/array.rb +0 -29
  110. data/lib/unparser/emitter/literal/dynamic.rb +0 -53
  111. data/lib/unparser/emitter/literal/dynamic_body.rb +0 -132
  112. data/lib/unparser/emitter/literal/execute_string.rb +0 -38
  113. data/lib/unparser/emitter/literal/hash.rb +0 -156
  114. data/lib/unparser/emitter/literal/primitive.rb +0 -145
  115. data/lib/unparser/emitter/literal/range.rb +0 -36
  116. data/lib/unparser/emitter/literal/regexp.rb +0 -114
  117. data/lib/unparser/emitter/literal/singleton.rb +0 -26
  118. data/lib/unparser/emitter/meta.rb +0 -16
  119. data/lib/unparser/emitter/redo.rb +0 -25
  120. data/lib/unparser/emitter/resbody.rb +0 -76
  121. data/lib/unparser/emitter/retry.rb +0 -25
  122. data/lib/unparser/emitter/send/binary.rb +0 -57
  123. data/lib/unparser/emitter/send/conditional.rb +0 -40
  124. data/lib/unparser/emitter/send/regular.rb +0 -40
  125. data/lib/unparser/preprocessor.rb +0 -159
  126. data/spec/integration/unparser/corpus_spec.rb +0 -111
  127. data/spec/integrations.yml +0 -92
  128. data/spec/spec_helper.rb +0 -20
  129. data/spec/unit/unparser/buffer/append_spec.rb +0 -24
  130. data/spec/unit/unparser/buffer/append_without_prefix_spec.rb +0 -23
  131. data/spec/unit/unparser/buffer/capture_content_spec.rb +0 -17
  132. data/spec/unit/unparser/buffer/content_spec.rb +0 -38
  133. data/spec/unit/unparser/buffer/fresh_line_spec.rb +0 -20
  134. data/spec/unit/unparser/buffer/indent_spec.rb +0 -20
  135. data/spec/unit/unparser/buffer/nl_spec.rb +0 -16
  136. data/spec/unit/unparser/buffer/unindent_spec.rb +0 -20
  137. data/spec/unit/unparser/comments/consume_spec.rb +0 -22
  138. data/spec/unit/unparser/comments/take_all_spec.rb +0 -19
  139. data/spec/unit/unparser/comments/take_before_spec.rb +0 -46
  140. data/spec/unit/unparser/comments/take_eol_comments_spec.rb +0 -32
  141. data/spec/unit/unparser/emitter/class_methods/handle_spec.rb +0 -17
  142. data/spec/unit/unparser_spec.rb +0 -1849
  143. data/unparser.gemspec +0 -32
@@ -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.7
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-04 00:00:00.000000000 Z
11
+ date: 2020-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type
@@ -39,19 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.2.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: equalizer
42
+ name: anima
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.9
47
+ version: 0.3.1
48
48
  type: :runtime
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.0.9
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
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: diff-lcs
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -67,19 +81,33 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '1.3'
69
83
  - !ruby/object:Gem::Dependency
70
- name: concord
84
+ name: equalizer
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: 0.1.5
89
+ version: 0.0.9
76
90
  type: :runtime
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: 0.1.5
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
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: parser
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -109,75 +137,103 @@ dependencies:
109
137
  - !ruby/object:Gem::Version
110
138
  version: 0.0.2
111
139
  - !ruby/object:Gem::Dependency
112
- name: anima
140
+ name: mutant
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: 0.3.1
145
+ version: 0.9.13
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: 0.3.1
152
+ version: 0.9.13
125
153
  - !ruby/object:Gem::Dependency
126
- name: devtools
154
+ name: mutant-rspec
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: 0.1.23
159
+ version: 0.9.13
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: 0.1.23
166
+ version: 0.9.13
139
167
  - !ruby/object:Gem::Dependency
140
- name: morpher
168
+ name: rspec
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
171
  - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: 0.2.6
173
+ version: '3.9'
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
178
  - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: 0.2.6
180
+ version: '3.9'
153
181
  - !ruby/object:Gem::Dependency
154
- name: mutant
182
+ name: rspec-core
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - "~>"
158
186
  - !ruby/object:Gem::Version
159
- version: 0.9.4
187
+ version: '3.9'
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
192
  - - "~>"
165
193
  - !ruby/object:Gem::Version
166
- version: 0.9.4
194
+ version: '3.9'
167
195
  - !ruby/object:Gem::Dependency
168
- name: mutant-rspec
196
+ name: rspec-its
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 1.2.0
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 1.2.0
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubocop
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 0.92.0
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: 0.92.0
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop-packaging
169
225
  requirement: !ruby/object:Gem::Requirement
170
226
  requirements:
171
227
  - - "~>"
172
228
  - !ruby/object:Gem::Version
173
- version: 0.9.4
229
+ version: 0.5.0
174
230
  type: :development
175
231
  prerelease: false
176
232
  version_requirements: !ruby/object:Gem::Requirement
177
233
  requirements:
178
234
  - - "~>"
179
235
  - !ruby/object:Gem::Version
180
- version: 0.9.4
236
+ version: 0.5.0
181
237
  description: Generate equivalent source for parser gem AST nodes
182
238
  email: mbj@schirp-dso.com
183
239
  executables:
@@ -186,113 +242,97 @@ extensions: []
186
242
  extra_rdoc_files:
187
243
  - README.md
188
244
  files:
189
- - ".circleci/config.yml"
190
- - ".gitignore"
191
- - ".rspec"
192
- - ".rubocop.yml"
193
- - Changelog.md
194
- - Gemfile
195
- - Gemfile.lock
196
- - LICENSE
197
245
  - README.md
198
- - Rakefile
199
246
  - bin/unparser
200
- - config/devtools.yml
201
- - config/flay.yml
202
- - config/flog.yml
203
- - config/mutant.yml
204
- - config/reek.yml
205
- - config/rubocop.yml
206
- - config/yardstick.yml
207
247
  - lib/unparser.rb
208
248
  - lib/unparser/ast.rb
209
249
  - lib/unparser/ast/local_variable_scope.rb
210
250
  - lib/unparser/buffer.rb
211
251
  - lib/unparser/cli.rb
212
- - lib/unparser/cli/color.rb
213
- - lib/unparser/cli/differ.rb
214
- - lib/unparser/cli/source.rb
252
+ - lib/unparser/color.rb
215
253
  - lib/unparser/comments.rb
216
254
  - lib/unparser/constants.rb
255
+ - lib/unparser/diff.rb
217
256
  - lib/unparser/dsl.rb
218
257
  - lib/unparser/emitter.rb
219
258
  - lib/unparser/emitter/alias.rb
259
+ - lib/unparser/emitter/args.rb
220
260
  - lib/unparser/emitter/argument.rb
261
+ - lib/unparser/emitter/array.rb
262
+ - lib/unparser/emitter/array_pattern.rb
221
263
  - lib/unparser/emitter/assignment.rb
222
264
  - lib/unparser/emitter/begin.rb
223
265
  - lib/unparser/emitter/binary.rb
224
266
  - lib/unparser/emitter/block.rb
225
267
  - lib/unparser/emitter/case.rb
268
+ - lib/unparser/emitter/case_guard.rb
269
+ - lib/unparser/emitter/case_match.rb
226
270
  - lib/unparser/emitter/cbase.rb
227
271
  - lib/unparser/emitter/class.rb
272
+ - lib/unparser/emitter/const_pattern.rb
228
273
  - lib/unparser/emitter/def.rb
229
274
  - lib/unparser/emitter/defined.rb
230
- - lib/unparser/emitter/empty.rb
231
- - lib/unparser/emitter/ensure.rb
275
+ - lib/unparser/emitter/dstr.rb
276
+ - lib/unparser/emitter/dsym.rb
232
277
  - lib/unparser/emitter/flipflop.rb
278
+ - lib/unparser/emitter/float.rb
233
279
  - lib/unparser/emitter/flow_modifier.rb
234
280
  - lib/unparser/emitter/for.rb
281
+ - lib/unparser/emitter/hash.rb
282
+ - lib/unparser/emitter/hash_pattern.rb
235
283
  - lib/unparser/emitter/hookexe.rb
236
284
  - lib/unparser/emitter/if.rb
285
+ - lib/unparser/emitter/in_match.rb
286
+ - lib/unparser/emitter/in_pattern.rb
237
287
  - lib/unparser/emitter/index.rb
288
+ - lib/unparser/emitter/kwbegin.rb
238
289
  - lib/unparser/emitter/lambda.rb
239
- - lib/unparser/emitter/literal.rb
240
- - lib/unparser/emitter/literal/array.rb
241
- - lib/unparser/emitter/literal/dynamic.rb
242
- - lib/unparser/emitter/literal/dynamic_body.rb
243
- - lib/unparser/emitter/literal/execute_string.rb
244
- - lib/unparser/emitter/literal/hash.rb
245
- - lib/unparser/emitter/literal/primitive.rb
246
- - lib/unparser/emitter/literal/range.rb
247
- - lib/unparser/emitter/literal/regexp.rb
248
- - lib/unparser/emitter/literal/singleton.rb
290
+ - lib/unparser/emitter/masgn.rb
249
291
  - lib/unparser/emitter/match.rb
250
- - 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
251
297
  - lib/unparser/emitter/module.rb
252
298
  - lib/unparser/emitter/op_assign.rb
253
- - 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
254
303
  - lib/unparser/emitter/repetition.rb
255
- - lib/unparser/emitter/resbody.rb
256
304
  - lib/unparser/emitter/rescue.rb
257
- - lib/unparser/emitter/retry.rb
258
305
  - lib/unparser/emitter/root.rb
259
306
  - lib/unparser/emitter/send.rb
260
- - lib/unparser/emitter/send/attribute_assignment.rb
261
- - lib/unparser/emitter/send/binary.rb
262
- - lib/unparser/emitter/send/conditional.rb
263
- - lib/unparser/emitter/send/regular.rb
264
- - lib/unparser/emitter/send/unary.rb
307
+ - lib/unparser/emitter/simple.rb
265
308
  - lib/unparser/emitter/splat.rb
266
309
  - lib/unparser/emitter/super.rb
267
310
  - lib/unparser/emitter/undef.rb
268
311
  - lib/unparser/emitter/variable.rb
312
+ - lib/unparser/emitter/xstr.rb
269
313
  - lib/unparser/emitter/yield.rb
270
314
  - lib/unparser/finalize.rb
315
+ - lib/unparser/generation.rb
316
+ - lib/unparser/node_details.rb
317
+ - lib/unparser/node_details/send.rb
271
318
  - lib/unparser/node_helpers.rb
272
- - lib/unparser/preprocessor.rb
273
- - spec/integration/unparser/corpus_spec.rb
274
- - spec/integrations.yml
275
- - spec/spec_helper.rb
276
- - spec/unit/unparser/buffer/append_spec.rb
277
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
278
- - spec/unit/unparser/buffer/capture_content_spec.rb
279
- - spec/unit/unparser/buffer/content_spec.rb
280
- - spec/unit/unparser/buffer/fresh_line_spec.rb
281
- - spec/unit/unparser/buffer/indent_spec.rb
282
- - spec/unit/unparser/buffer/nl_spec.rb
283
- - spec/unit/unparser/buffer/unindent_spec.rb
284
- - spec/unit/unparser/comments/consume_spec.rb
285
- - spec/unit/unparser/comments/take_all_spec.rb
286
- - spec/unit/unparser/comments/take_before_spec.rb
287
- - spec/unit/unparser/comments/take_eol_comments_spec.rb
288
- - spec/unit/unparser/emitter/class_methods/handle_spec.rb
289
- - spec/unit/unparser_spec.rb
290
- - unparser.gemspec
319
+ - lib/unparser/validation.rb
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
291
331
  homepage: http://github.com/mbj/unparser
292
332
  licenses:
293
333
  - MIT
294
334
  metadata: {}
295
- post_install_message:
335
+ post_install_message:
296
336
  rdoc_options: []
297
337
  require_paths:
298
338
  - lib
@@ -307,25 +347,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
347
  - !ruby/object:Gem::Version
308
348
  version: '0'
309
349
  requirements: []
310
- rubygems_version: 3.0.3
311
- signing_key:
350
+ rubygems_version: 3.1.4
351
+ signing_key:
312
352
  specification_version: 4
313
353
  summary: Generate equivalent source for parser gem AST nodes
314
- test_files:
315
- - spec/integration/unparser/corpus_spec.rb
316
- - spec/integrations.yml
317
- - spec/spec_helper.rb
318
- - spec/unit/unparser/buffer/append_spec.rb
319
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
320
- - spec/unit/unparser/buffer/capture_content_spec.rb
321
- - spec/unit/unparser/buffer/content_spec.rb
322
- - spec/unit/unparser/buffer/fresh_line_spec.rb
323
- - spec/unit/unparser/buffer/indent_spec.rb
324
- - spec/unit/unparser/buffer/nl_spec.rb
325
- - spec/unit/unparser/buffer/unindent_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/emitter/class_methods/handle_spec.rb
331
- - spec/unit/unparser_spec.rb
354
+ test_files: []