diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2016-02-14 15:08:30 +0100 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2016-02-14 15:08:30 +0100 |
commit | 13ac3fdc6fa5330c9eacc6ac9be92a869ab8d3be (patch) | |
tree | 0cf34739e36f452fa9086455d052589d3ce075e6 /lib/coderay/scanners | |
parent | f8cadd9fce43c48ed4b32685f62e99f8770b8963 (diff) | |
download | coderay-13ac3fdc6fa5330c9eacc6ac9be92a869ab8d3be.tar.gz |
optional push state (return nil)
Diffstat (limited to 'lib/coderay/scanners')
-rw-r--r-- | lib/coderay/scanners/lua2.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/coderay/scanners/lua2.rb b/lib/coderay/scanners/lua2.rb index 4b99a44..8426834 100644 --- a/lib/coderay/scanners/lua2.rb +++ b/lib/coderay/scanners/lua2.rb @@ -66,17 +66,15 @@ module Scanners on %r/::\s*[a-zA-Z_][a-zA-Z0-9_]+\s*::/, :label # ::goto_label:: on %r/_[A-Z]+/, :predefined # _UPPERCASE are names reserved for Lua on check_if { |brace_depth| brace_depth > 0 }, %r/([a-zA-Z_][a-zA-Z0-9_]*) (\s+)?(=)/x, groups(:key, :space, :operator) - on %r/[a-zA-Z_][a-zA-Z0-9_]*/, kind { |match| IDENT_KIND[match] }, push_state { |match, kind, state| # Normal letters (or letters followed by digits) + on %r/[a-zA-Z_][a-zA-Z0-9_]*/, kind { |match| IDENT_KIND[match] }, push_state { |match, kind| # Normal letters (or letters followed by digits) # Extra highlighting for entities following certain keywords if kind == :keyword && match == 'function' - state = :function_expected + :function_expected elsif kind == :keyword && match == 'goto' - state = :goto_label_expected + :goto_label_expected elsif kind == :keyword && match == 'local' - state = :local_var_expected + :local_var_expected end - - state } on %r/\{/, push(:map), kind { |brace_depth| brace_depth > 0 ? :inline_delimiter : :delimiter }, increment(:brace_depth) # Opening table brace { |