diff options
Diffstat (limited to 'lib/coderay/scanners/lua2.rb')
-rw-r--r-- | lib/coderay/scanners/lua2.rb | 18 |
1 files changed, 9 insertions, 9 deletions
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 |