Token

class Token(val content: String, val scope: String, val depth: Int, val language: Language, val allScopes: List<String>, val lineNumber: Int, val startIndex: Int, val endIndex: Int)(source)

The Token that will be passed to the diffing algorithm to find structural similarities.

We are using a combination of the content, and the primary scope + its depth to find anchors.

Constructors

Link copied to clipboard
constructor(content: String, scope: String, depth: Int, language: Language, allScopes: List<String>, lineNumber: Int, startIndex: Int, endIndex: Int)

Properties

Link copied to clipboard
Link copied to clipboard

The actual content of the parsed token.

Link copied to clipboard
val depth: Int

The depth of the primary scope.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A related token, when applicable. This is only ever populated for Tokens that are brackets. So }, ], >, ) will point to their corresponding matching pairs.

Link copied to clipboard
Link copied to clipboard

The primary scope

Link copied to clipboard

Functions

Link copied to clipboard
fun assignKey(newKey: String)
Link copied to clipboard
fun assignRelated(related: Token, relatedIndex: Int)
Link copied to clipboard
fun Token.color(): Color
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
fun key(): String
Link copied to clipboard
open override fun toString(): String