Creates a new string-based comparison token.
The string value for this token.
Optionaldata: unknownOptional user-defined payload.
ReadonlydataOptional user-defined payload attached to this token.
ReadonlytokenThe string value of this token.
Determines whether this token matches another token.
The token to compare against.
true if the tokens are considered equivalent.
Matching rules depend on the type of other:
Returns a formatted string representation of this token.
Number of leading spaces.
A formatted, human-readable string.
A ComparisonUnitToken that matches by string equality.
Remarks
Two
ComparisonUnitTokenStringinstances match when their tokenString values are identical. For single-character strings, private-use-area bullet characters (e.g.\uF0B7) are normalised to their Unicode equivalents (e.g.\u2022) before comparison.When compared against a ComparisonUnitTokenRegex, the regex is tested against this token's string.
Example