From 90c5c9161f53ee6e8400b3af2e967820ba0addd9 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 14 Feb 2016 19:25:35 +0100 Subject: remove templates, yay! --- lib/coderay/scanners/lua2.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/coderay/scanners/lua2.rb') diff --git a/lib/coderay/scanners/lua2.rb b/lib/coderay/scanners/lua2.rb index f48627d..fa20e9b 100644 --- a/lib/coderay/scanners/lua2.rb +++ b/lib/coderay/scanners/lua2.rb @@ -48,15 +48,6 @@ module Scanners add(PREDEFINED_CONSTANTS, :predefined_constant). add(PREDEFINED_EXPRESSIONS, :predefined) - protected - - # Scanner initialization. - def setup - super - @brace_depth = 0 - @num_equals = nil - end - state :initial, :map do on %r/\-\-\[\=*\[/, push(:long_comment, :comment), :delimiter, #--[[ long (possibly multiline) comment ]] set(:num_equals, -> (match) { match.count('=') }) # Number must match for comment end @@ -139,6 +130,15 @@ module Scanners # encoder.text_token("\\n\n", :error) # Visually appealing error indicator--otherwise users may wonder whether the highlighter cannot highlight multine strings end + protected + + def setup + super + + @brace_depth = 0 + @num_equals = nil + end + def close_groups encoder, states states.reverse_each do |state| case state -- cgit v1.2.1