mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
AST traverse
This commit is contained in:
parent
f1e462cc86
commit
2eef485501
2 changed files with 18 additions and 0 deletions
18
spec/ameba/ast_traverse_spec.cr
Normal file
18
spec/ameba/ast_traverse_spec.cr
Normal 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
|
Loading…
Reference in a new issue