镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/coderay/scanners/groovy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setup
def scan_tokens encoder, options
state = options[:state] || @state
inline_block_stack = []
inline_block_paren_depth = nil
inline_block_paren_depth = 0
string_delimiter = nil
import_clause = class_name_follows = last_token = after_def = false
value_expected = true
Expand Down Expand Up @@ -196,7 +196,8 @@ def scan_tokens encoder, options

elsif (state == :string || state == :multiline_string) &&
(match = scan(/ \\ (?: #{ESCAPE} | #{UNICODE_ESCAPE} ) /mox))
if string_delimiter[0] == ?' && !(match == "\\\\" || match == "\\'")
if !(string_delimiter.nil?) && string_delimiter.kind_of?(Array) \
&& string_delimiter[0] == ?' && !(match == "\\\\" || match == "\\'")
encoder.text_token match, :content
else
encoder.text_token match, :char
Expand Down