From 08dedcd78aff28e736dd65c6907193a5a00d4311 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 12 Oct 2015 17:57:12 +0900 Subject: [PATCH] Opt-in AST node type --- lib/hamlit/compiler.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/hamlit/compiler.rb b/lib/hamlit/compiler.rb index 1d679fe0..36f33f1a 100644 --- a/lib/hamlit/compiler.rb +++ b/lib/hamlit/compiler.rb @@ -34,8 +34,10 @@ module Hamlit compile_tag(node) when :plain compile_plain(node) - else + when :haml_comment [:multi] + else + raise InternalError.new("Unexpected node type: #{node.type}") end end @@ -62,5 +64,8 @@ module Hamlit def compile_plain(node) [:static, node.value[:text]] end + + class InternalError < RuntimeError + end end end