diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2016-02-14 19:25:35 +0100 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2016-02-14 19:25:35 +0100 |
commit | 90c5c9161f53ee6e8400b3af2e967820ba0addd9 (patch) | |
tree | 7b10bb3fd98da1b432cfc49482f598213701bfa9 /lib/coderay/scanners/lua2.rb | |
parent | 14339bfc8f58ac883bb5f202411804f03966f462 (diff) | |
download | coderay-90c5c9161f53ee6e8400b3af2e967820ba0addd9.tar.gz |
remove templates, yay!
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 |