Module: Hamlit::Concerns::Error
- Included in:
- Indentable, Parsers::Script, Parsers::Tag
- Defined in:
- lib/hamlit/concerns/error.rb
Instance Method Summary collapse
- #assert_scan!(scanner, regexp) ⇒ Object
- #copmile_error!(message) ⇒ Object
-
#syntax_error(message) ⇒ Object
Template engine should raise Exception on runtime to show template's error backtrace.
Instance Method Details
#assert_scan!(scanner, regexp) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/hamlit/concerns/error.rb', line 18 def assert_scan!(scanner, regexp) result = scanner.scan(regexp) unless result raise CompileError.new("Expected to scan #{regexp} but got nil") end result end |
#copmile_error!(message) ⇒ Object
14 15 16 |
# File 'lib/hamlit/concerns/error.rb', line 14 def copmile_error!() raise CompileError.new() end |
#syntax_error(message) ⇒ Object
Template engine should raise Exception on runtime to show template's error backtrace.
9 10 11 12 |
# File 'lib/hamlit/concerns/error.rb', line 9 def syntax_error() code = %Q{raise Hamlit::SyntaxError.new(%q{#{}})} [:code, code] end |