AST traverse

This commit is contained in:
Vitalii Elenhaupt 2017-11-01 01:06:47 +02:00
parent f1e462cc86
commit 2eef485501
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,18 @@
require "../spec_helper"
module Ameba
rule = DummyRule.new
source = Source.new ""
describe "AST Traverse" do
{% for name in NODE_VISITORS %}
describe "{{name}}" do
it "allow to visit {{name}} node" do
visitor = {{name}}Visitor.new rule, source
nodes = Crystal::Parser.new("").parse
nodes.accept visitor
end
end
{% end %}
end
end