NameToken

data class NameToken(body: String, index: String?)

A single name token. Body is not allowed to be empty. Following symbols are prohibited in name tokens: {}.:\. A name token could have appendix in square brackets called index

Constructors

NameToken
Link copied to clipboard
common
fun NameToken(body: String, index: String? = null)

Functions

toString
Link copied to clipboard
common
open override fun toString(): String

Properties

body
Link copied to clipboard
common
val body: String
index
Link copied to clipboard
common
val index: String? = null

Extensions

asName
Link copied to clipboard
common
fun NameToken.asName(): Name
hasIndex
Link copied to clipboard
common
fun NameToken.hasIndex(): Boolean

Check if index is defined for this token

matches
Link copied to clipboard
common
fun NameToken.matches(pattern: NameToken): Boolean

Checks if this token matches a given NameToken. The match successful if:

plus
Link copied to clipboard
common
operator fun NameToken.plus(other: Name): Name
withIndex
Link copied to clipboard
common
fun NameToken.withIndex(newIndex: String): NameToken

Add or replace index part of this token