Skip to content
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

Ensure word break exists after keywords in Kotlin lexer #1621

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rouge/lexers/kotlin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Kotlin < RegexLexer
groups Keyword::Declaration, Text
push :property
end
rule %r'(return|continue|break|this|super)(@#{name})?' do
rule %r'(return|continue|break|this|super)(@#{name})?\b' do
groups Keyword, Name::Decorator
end
rule %r'\bfun\b', Keyword
Expand Down
10 changes: 7 additions & 3 deletions spec/visual/samples/kotlin
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,19 @@ fun <T, V> genericFunction() {
}

fun String.extensionFunction() {
return
return
}

fun `String`.`backTickedExtensionFunction`() {
return
return
}

fun <T, V : Comparable> String.genericExtensionFunction() {
return
return
}

fun foo(supersedingStuff: List<String>): List<String> {
return supersedingStuff.map { it }
}

inline fun <reified T> membersOf() = T::class.members
Expand Down