Skip to content

Commit

Permalink
Have rake task trigger generate too
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Aug 30, 2020
1 parent cc98411 commit 33bddc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/compile.rake
Expand Up @@ -45,7 +45,7 @@ rule '.racc.rb' => '.y' do |t|
end

desc 'Compile pattern to Ruby code for debugging purposes'
task :compile do
task compile: :generate do
if (pattern = ARGV[1])
require_relative '../lib/rubocop/ast'
puts ::RuboCop::AST::NodePattern.new(pattern).compile_as_lambda
Expand All @@ -57,7 +57,7 @@ task :compile do
end

desc 'Parse pattern to AST for debugging purposes'
task :parse do
task parse: :generate do
if (pattern = ARGV[1])
require_relative '../lib/rubocop/ast'
puts ::RuboCop::AST::NodePattern::Parser.new.parse(pattern)
Expand All @@ -69,7 +69,7 @@ task :parse do
end

desc 'Tokens of pattern for debugging purposes'
task :tokenize do
task tokenize: :generate do
if (pattern = ARGV[1])
require_relative '../lib/rubocop/ast'
puts ::RuboCop::AST::NodePattern::Parser::WithMeta.new.tokenize(pattern).last
Expand All @@ -81,7 +81,7 @@ task :tokenize do
end

desc 'Test pattern against ruby code'
task :test_pattern do
task test_pattern: :generate do
if (pattern = ARGV[1]) && (ruby = ARGV[2])
require_relative '../lib/rubocop/ast'
require 'parser/current'
Expand Down

0 comments on commit 33bddc4

Please sign in to comment.