Add NameToket.toStringUnescaped
This commit is contained in:
parent
0b68c1edae
commit
9cceb44a90
@ -27,6 +27,16 @@ public data class NameToken(val body: String, val index: String? = null) {
|
||||
body.escape()
|
||||
}
|
||||
|
||||
/**
|
||||
* Return unescaped version of the [NameToken]. Should be used only for output because it is not possible to correctly
|
||||
* parse it back.
|
||||
*/
|
||||
public fun toStringUnescaped(): String = if (hasIndex()) {
|
||||
"${body}[$index]"
|
||||
} else {
|
||||
body
|
||||
}
|
||||
|
||||
public companion object {
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user