Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55ae922

Browse filesBrowse files
authored
Merge pull request #29 from SnipMeDev/publish-0.8.0
Publish 0.8.0
2 parents 98caa5c + 63f173b commit 55ae922
Copy full SHA for 55ae922

File tree

Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed

‎src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt

Copy file name to clipboardExpand all lines: src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ internal object NumericLiteralLocator {
3131
} // Find start of literals
3232
.forEach { number ->
3333
// For given literal find all occurrences
34-
code.indicesOf(number).forEach { startIndex ->
34+
val indices = code.indicesOf(number)
35+
for (startIndex in indices) {
36+
// TODO Correct this and publish
3537
if (code.isFullNumber(number, startIndex).not()) return@forEach
3638
// Omit in the middle of text, probably variable name (this100)
3739
if (code.isNumberFirstIndex(startIndex).not()) return@forEach

‎src/commonMain/kotlin/dev/snipme/highlights/internal/locator/PunctuationLocator.kt

Copy file name to clipboardExpand all lines: src/commonMain/kotlin/dev/snipme/highlights/internal/locator/PunctuationLocator.kt
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package dev.snipme.highlights.internal.locator
22

3-
import dev.snipme.highlights.model.PhraseLocation
43
import dev.snipme.highlights.internal.SyntaxTokens.PUNCTUATION_CHARACTERS
54
import dev.snipme.highlights.internal.SyntaxTokens.TOKEN_DELIMITERS
65
import dev.snipme.highlights.internal.indicesOf
6+
import dev.snipme.highlights.model.PhraseLocation
77

88
internal object PunctuationLocator {
99
fun locate(code: String): List<PhraseLocation> {
@@ -14,7 +14,8 @@ internal object PunctuationLocator {
1414
.filter { it.isNotBlank() }
1515
.filter { it in PUNCTUATION_CHARACTERS }
1616
.forEach {
17-
code.indicesOf(it, ).forEach { index ->
17+
val indices = code.indicesOf(it)
18+
for (index in indices) {
1819
if (code[index].isWhitespace()) return@forEach
1920
locations.add(PhraseLocation(index, index + 1))
2021
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.