summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2012-06-19 18:05:04 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2012-06-19 18:05:04 +0200
commit2b16d115f7d6caf21864934df763556e126d6357 (patch)
tree6432abcd57d76e69de30eeb5d0bf26936bf4cff6 /lib
parent3dd61402fdbabd2574dd79f2b287f629ec9f4782 (diff)
downloadcoderay-2b16d115f7d6caf21864934df763556e126d6357.tar.gz
fix for Ruby 1.8, escape { and } in regexps
Diffstat (limited to 'lib')
-rw-r--r--lib/coderay/scanners/lua.rb12
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)