Skip to content

Kotlin scanner #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Kotlin: fix regexp escapes
  • Loading branch information
Sergey Mashkov committed Aug 6, 2017
commit 356644ed055063de44fe5edb7abddfbe95782c2c
8 changes: 4 additions & 4 deletions lib/coderay/scanners/kotlin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def scan_tokens encoder, options
encoder.text_token match, kind
elsif (match = scan(/ \.(?!\d) | [,?:()\[\]] | -- | \+\+ | && | \|\| | \*\*=? | [-+*\/%^~&|<>=!]=? /x))
encoder.text_token match, :operator
elsif (match = scan(/{/))
elsif (match = scan(/\{/))
class_name_follows = false
encoder.text_token match, :operator
states << :initial
elsif (match = scan(/}/))
elsif (match = scan(/\}/))
encoder.text_token match, :operator

unless states.empty?
Expand Down Expand Up @@ -131,7 +131,7 @@ def scan_tokens encoder, options
end

when :string
if (match = scan(/\${/))
if (match = scan(/\$\{/))
encoder.text_token match, :operator

state = :initial
Expand Down Expand Up @@ -163,7 +163,7 @@ def scan_tokens encoder, options
raise_inspect "else case \" reached; %p not handled." % peek(1), encoder
end
when :multiline_string
if (match = scan(/\${/))
if (match = scan(/\$\{/))
encoder.text_token match, :operator

state = :initial
Expand Down