unparser 0.4.6 → 0.5.1

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 +117 -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 +151 -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 +151 -100
  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 -150
  93. data/Gemfile +0 -11
  94. data/Gemfile.lock +0 -176
  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 -1847
  143. data/unparser.gemspec +0 -30
@@ -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?
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.6
4
+ version: 0.5.1
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-09 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,31 +81,45 @@ 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
83
97
  - !ruby/object:Gem::Dependency
84
- name: parser
98
+ name: mprelude
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: 2.6.5
103
+ version: 0.1.0
90
104
  type: :runtime
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.1.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: parser
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 2.6.5
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
95
123
  - !ruby/object:Gem::Version
96
124
  version: 2.6.5
97
125
  - !ruby/object:Gem::Dependency
@@ -109,47 +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
153
+ - !ruby/object:Gem::Dependency
154
+ name: mutant-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.9.13
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.9.13
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.9'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.9'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec-core
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '3.9'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '3.9'
195
+ - !ruby/object:Gem::Dependency
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
125
209
  - !ruby/object:Gem::Dependency
126
- name: devtools
210
+ name: rubocop
127
211
  requirement: !ruby/object:Gem::Requirement
128
212
  requirements:
129
213
  - - "~>"
130
214
  - !ruby/object:Gem::Version
131
- version: 0.1.23
215
+ version: 0.92.0
132
216
  type: :development
133
217
  prerelease: false
134
218
  version_requirements: !ruby/object:Gem::Requirement
135
219
  requirements:
136
220
  - - "~>"
137
221
  - !ruby/object:Gem::Version
138
- version: 0.1.23
222
+ version: 0.92.0
139
223
  - !ruby/object:Gem::Dependency
140
- name: morpher
224
+ name: rubocop-packaging
141
225
  requirement: !ruby/object:Gem::Requirement
142
226
  requirements:
143
227
  - - "~>"
144
228
  - !ruby/object:Gem::Version
145
- version: 0.2.6
229
+ version: 0.5.0
146
230
  type: :development
147
231
  prerelease: false
148
232
  version_requirements: !ruby/object:Gem::Requirement
149
233
  requirements:
150
234
  - - "~>"
151
235
  - !ruby/object:Gem::Version
152
- version: 0.2.6
236
+ version: 0.5.0
153
237
  description: Generate equivalent source for parser gem AST nodes
154
238
  email: mbj@schirp-dso.com
155
239
  executables:
@@ -158,113 +242,97 @@ extensions: []
158
242
  extra_rdoc_files:
159
243
  - README.md
160
244
  files:
161
- - ".circleci/config.yml"
162
- - ".gitignore"
163
- - ".rspec"
164
- - ".rubocop.yml"
165
- - Changelog.md
166
- - Gemfile
167
- - Gemfile.lock
168
- - LICENSE
169
245
  - README.md
170
- - Rakefile
171
246
  - bin/unparser
172
- - config/devtools.yml
173
- - config/flay.yml
174
- - config/flog.yml
175
- - config/mutant.yml
176
- - config/reek.yml
177
- - config/rubocop.yml
178
- - config/yardstick.yml
179
247
  - lib/unparser.rb
180
248
  - lib/unparser/ast.rb
181
249
  - lib/unparser/ast/local_variable_scope.rb
182
250
  - lib/unparser/buffer.rb
183
251
  - lib/unparser/cli.rb
184
- - lib/unparser/cli/color.rb
185
- - lib/unparser/cli/differ.rb
186
- - lib/unparser/cli/source.rb
252
+ - lib/unparser/color.rb
187
253
  - lib/unparser/comments.rb
188
254
  - lib/unparser/constants.rb
255
+ - lib/unparser/diff.rb
189
256
  - lib/unparser/dsl.rb
190
257
  - lib/unparser/emitter.rb
191
258
  - lib/unparser/emitter/alias.rb
259
+ - lib/unparser/emitter/args.rb
192
260
  - lib/unparser/emitter/argument.rb
261
+ - lib/unparser/emitter/array.rb
262
+ - lib/unparser/emitter/array_pattern.rb
193
263
  - lib/unparser/emitter/assignment.rb
194
264
  - lib/unparser/emitter/begin.rb
195
265
  - lib/unparser/emitter/binary.rb
196
266
  - lib/unparser/emitter/block.rb
197
267
  - lib/unparser/emitter/case.rb
268
+ - lib/unparser/emitter/case_guard.rb
269
+ - lib/unparser/emitter/case_match.rb
198
270
  - lib/unparser/emitter/cbase.rb
199
271
  - lib/unparser/emitter/class.rb
272
+ - lib/unparser/emitter/const_pattern.rb
200
273
  - lib/unparser/emitter/def.rb
201
274
  - lib/unparser/emitter/defined.rb
202
- - lib/unparser/emitter/empty.rb
203
- - lib/unparser/emitter/ensure.rb
275
+ - lib/unparser/emitter/dstr.rb
276
+ - lib/unparser/emitter/dsym.rb
204
277
  - lib/unparser/emitter/flipflop.rb
278
+ - lib/unparser/emitter/float.rb
205
279
  - lib/unparser/emitter/flow_modifier.rb
206
280
  - lib/unparser/emitter/for.rb
281
+ - lib/unparser/emitter/hash.rb
282
+ - lib/unparser/emitter/hash_pattern.rb
207
283
  - lib/unparser/emitter/hookexe.rb
208
284
  - lib/unparser/emitter/if.rb
285
+ - lib/unparser/emitter/in_match.rb
286
+ - lib/unparser/emitter/in_pattern.rb
209
287
  - lib/unparser/emitter/index.rb
288
+ - lib/unparser/emitter/kwbegin.rb
210
289
  - lib/unparser/emitter/lambda.rb
211
- - lib/unparser/emitter/literal.rb
212
- - lib/unparser/emitter/literal/array.rb
213
- - lib/unparser/emitter/literal/dynamic.rb
214
- - lib/unparser/emitter/literal/dynamic_body.rb
215
- - lib/unparser/emitter/literal/execute_string.rb
216
- - lib/unparser/emitter/literal/hash.rb
217
- - lib/unparser/emitter/literal/primitive.rb
218
- - lib/unparser/emitter/literal/range.rb
219
- - lib/unparser/emitter/literal/regexp.rb
220
- - lib/unparser/emitter/literal/singleton.rb
290
+ - lib/unparser/emitter/masgn.rb
221
291
  - lib/unparser/emitter/match.rb
222
- - 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
223
297
  - lib/unparser/emitter/module.rb
224
298
  - lib/unparser/emitter/op_assign.rb
225
- - 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
226
303
  - lib/unparser/emitter/repetition.rb
227
- - lib/unparser/emitter/resbody.rb
228
304
  - lib/unparser/emitter/rescue.rb
229
- - lib/unparser/emitter/retry.rb
230
305
  - lib/unparser/emitter/root.rb
231
306
  - lib/unparser/emitter/send.rb
232
- - lib/unparser/emitter/send/attribute_assignment.rb
233
- - lib/unparser/emitter/send/binary.rb
234
- - lib/unparser/emitter/send/conditional.rb
235
- - lib/unparser/emitter/send/regular.rb
236
- - lib/unparser/emitter/send/unary.rb
307
+ - lib/unparser/emitter/simple.rb
237
308
  - lib/unparser/emitter/splat.rb
238
309
  - lib/unparser/emitter/super.rb
239
310
  - lib/unparser/emitter/undef.rb
240
311
  - lib/unparser/emitter/variable.rb
312
+ - lib/unparser/emitter/xstr.rb
241
313
  - lib/unparser/emitter/yield.rb
242
314
  - lib/unparser/finalize.rb
315
+ - lib/unparser/generation.rb
316
+ - lib/unparser/node_details.rb
317
+ - lib/unparser/node_details/send.rb
243
318
  - lib/unparser/node_helpers.rb
244
- - lib/unparser/preprocessor.rb
245
- - spec/integration/unparser/corpus_spec.rb
246
- - spec/integrations.yml
247
- - spec/spec_helper.rb
248
- - spec/unit/unparser/buffer/append_spec.rb
249
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
250
- - spec/unit/unparser/buffer/capture_content_spec.rb
251
- - spec/unit/unparser/buffer/content_spec.rb
252
- - spec/unit/unparser/buffer/fresh_line_spec.rb
253
- - spec/unit/unparser/buffer/indent_spec.rb
254
- - spec/unit/unparser/buffer/nl_spec.rb
255
- - spec/unit/unparser/buffer/unindent_spec.rb
256
- - spec/unit/unparser/comments/consume_spec.rb
257
- - spec/unit/unparser/comments/take_all_spec.rb
258
- - spec/unit/unparser/comments/take_before_spec.rb
259
- - spec/unit/unparser/comments/take_eol_comments_spec.rb
260
- - spec/unit/unparser/emitter/class_methods/handle_spec.rb
261
- - spec/unit/unparser_spec.rb
262
- - 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
263
331
  homepage: http://github.com/mbj/unparser
264
332
  licenses:
265
333
  - MIT
266
334
  metadata: {}
267
- post_install_message:
335
+ post_install_message:
268
336
  rdoc_options: []
269
337
  require_paths:
270
338
  - lib
@@ -279,25 +347,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
347
  - !ruby/object:Gem::Version
280
348
  version: '0'
281
349
  requirements: []
282
- rubygems_version: 3.0.3
283
- signing_key:
350
+ rubygems_version: 3.1.4
351
+ signing_key:
284
352
  specification_version: 4
285
353
  summary: Generate equivalent source for parser gem AST nodes
286
- test_files:
287
- - spec/integration/unparser/corpus_spec.rb
288
- - spec/integrations.yml
289
- - spec/spec_helper.rb
290
- - spec/unit/unparser/buffer/append_spec.rb
291
- - spec/unit/unparser/buffer/append_without_prefix_spec.rb
292
- - spec/unit/unparser/buffer/capture_content_spec.rb
293
- - spec/unit/unparser/buffer/content_spec.rb
294
- - spec/unit/unparser/buffer/fresh_line_spec.rb
295
- - spec/unit/unparser/buffer/indent_spec.rb
296
- - spec/unit/unparser/buffer/nl_spec.rb
297
- - spec/unit/unparser/buffer/unindent_spec.rb
298
- - spec/unit/unparser/comments/consume_spec.rb
299
- - spec/unit/unparser/comments/take_all_spec.rb
300
- - spec/unit/unparser/comments/take_before_spec.rb
301
- - spec/unit/unparser/comments/take_eol_comments_spec.rb
302
- - spec/unit/unparser/emitter/class_methods/handle_spec.rb
303
- - spec/unit/unparser_spec.rb
354
+ test_files: []