Skip to content

Commit 77da3cf

Browse files
author
Steve Ramage
committed
docs: attach colorize()'s KDoc to colorize(), not labeledRegions()
labeledRegions() was inserted between colorize()'s doc comment and its body; reorder so each function sits under its own KDoc.
1 parent f41d876 commit 77da3cf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata/optionvalues/grammar

src/main/kotlin/net/sjrx/intellij/plugins/systemdunitfiles/semanticdata/optionvalues/grammar/Coloring.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ fun defaultRole(terminal: TerminalCombinator): Role? = when (terminal) {
4242
private fun Array<out String>.allPunctuation(): Boolean =
4343
isNotEmpty() && all { choice -> choice.isNotEmpty() && choice.none(Char::isLetterOrDigit) }
4444

45-
/**
46-
* The coloured regions for [value]. Explicit [Labeled] regions win; any token not inside a labeled
47-
* region gets its terminal's [defaultRole]. Returns empty if no full parse exists — we don't colour
48-
* values that don't match the grammar.
49-
*/
5045
/**
5146
* The explicit [Labeled] spans in [value] (e.g. a whole IP address), from the first fully-valid
5247
* parse — i.e. structure the grammar marked, without the per-token coloring defaults. Used by
@@ -58,6 +53,11 @@ fun Combinator.labeledRegions(value: String): List<Region> {
5853
return parse.regions
5954
}
6055

56+
/**
57+
* The coloured regions for [value]. Explicit [Labeled] regions win; any token not inside a labeled
58+
* region gets its terminal's [defaultRole]. Returns empty if no full parse exists — we don't colour
59+
* values that don't match the grammar.
60+
*/
6161
fun Combinator.colorize(value: String): List<Region> {
6262
val parse = parse(value, 0).filterIsInstance<Parse>().firstOrNull { it.end == value.length } ?: return emptyList()
6363

0 commit comments

Comments
 (0)