Skip to content

Commit

Permalink
remove redo_until_no_change dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Jan 27, 2024
1 parent b6725ac commit 4e296c4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ DSLs are as follows
* [helper_method](https://xinminlabs.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#helper_method-instance_method) - define a helper method
* [add_snippet](https://xinminlabs.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#add_snippet-instance_method) - call another rewriter
* [call_helper](https://xinminlabs.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#call_helper-instance_method) - call a shared rewriter
* [redo_until_no_change](https://xinminlabs.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#redo_until_no_change-instance_method) - run the snippet until no change

Scopes:

Expand Down
15 changes: 0 additions & 15 deletions lib/synvert/core/rewriter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def initialize(group, name, &block)
@sub_snippets = []
@warnings = []
@affected_files = Set.new
@redo_until_no_change = false
@options = DEFAULT_OPTIONS.dup
@test_results = Hash.new { |h, k| h[k] = [] }
self.class.register(@group, @name, self)
Expand All @@ -130,8 +129,6 @@ def initialize(group, name, &block)
def process
@affected_files = Set.new
instance_eval(&@block)

process if !@affected_files.empty? && @redo_until_no_change # redo
end

# Process rewriter with sandbox mode.
Expand All @@ -146,9 +143,6 @@ def test
@affected_files = Set.new
instance_eval(&@block)

if !@affected_files.empty? && @redo_until_no_change # redo
test
end
if Configuration.test_result == 'new_source'
@test_results.values.flatten
else
Expand Down Expand Up @@ -406,15 +400,6 @@ def helper_method(name, &block)
@helpers << { name: name, block: block }
end

# Rerun the snippet until no change.
# @example
# Synvert::Rewriter.new 'ruby', 'nested_class_definition' do
# redo_until_no_change
# end
def redo_until_no_change
@redo_until_no_change = true
end

private

# Handle one file.
Expand Down
9 changes: 0 additions & 9 deletions spec/synvert/core/rewriter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,6 @@ module Synvert::Core
expect(instance.dynamic_helper('arg1', 'arg2')).to eq 'dynamic result'
end

it 'parses redo_until_no_change' do
rewriter =
Rewriter.new 'group', 'name' do
redo_until_no_change
end
rewriter.process
expect(rewriter.instance_variable_get('@redo_until_no_change')).to be_truthy
end

describe 'class methods' do
before :each do
Rewriter.clear
Expand Down

0 comments on commit 4e296c4

Please sign in to comment.