diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2012-06-19 18:05:04 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2012-06-19 18:05:04 +0200 |
commit | 2b16d115f7d6caf21864934df763556e126d6357 (patch) | |
tree | 6432abcd57d76e69de30eeb5d0bf26936bf4cff6 /lib | |
parent | 3dd61402fdbabd2574dd79f2b287f629ec9f4782 (diff) | |
download | coderay-2b16d115f7d6caf21864934df763556e126d6357.tar.gz |
fix for Ruby 1.8, escape { and } in regexps
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coderay/scanners/lua.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/coderay/scanners/lua.rb b/lib/coderay/scanners/lua.rb index e7706fc..8464ef7 100644 --- a/lib/coderay/scanners/lua.rb +++ b/lib/coderay/scanners/lua.rb @@ -40,10 +40,10 @@ class CodeRay::Scanners::Lua < CodeRay::Scanners::Scanner ] # Automatic token kind selection for normal words. - IDENT_KIND = CodeRay::WordList.new(:ident) - .add(KEYWORDS, :keyword) - .add(PREDEFINED_CONSTANTS, :predefined_constant) - .add(PREDEFINED_EXPRESSIONS, :predefined) + IDENT_KIND = CodeRay::WordList.new(:ident). + add(KEYWORDS, :keyword). + add(PREDEFINED_CONSTANTS, :predefined_constant). + add(PREDEFINED_EXPRESSIONS, :predefined) protected @@ -99,13 +99,13 @@ class CodeRay::Scanners::Lua < CodeRay::Scanners::Scanner @encoder.text_token(match, kind) - elsif match = scan(/{/) # Opening table brace { + elsif match = scan(/\{/) # Opening table brace { @encoder.begin_group(:table) @encoder.text_token(match, @brace_depth >= 1 ? :inline_delimiter : :delimiter) @brace_depth += 1 @state = :table - elsif match = scan(/}/) # Closing table brace } + elsif match = scan(/\}/) # Closing table brace } if @brace_depth == 1 @brace_depth = 0 @encoder.text_token(match, :delimiter) |