StringTokenImpl.fromSubstring constructor
StringTokenImpl.fromSubstring(})
Creates a lazy string token. If canonicalize
is true, the string
is canonicalized before the token is created.
Implementation
StringTokenImpl.fromSubstring(
TokenType type, String data, int start, int end, int charOffset,
{bool canonicalize = false, CommentToken? precedingComments})
: super(type, charOffset, precedingComments) {
int length = end - start;
if (length <= LAZY_THRESHOLD) {
valueOrLazySubstring =
canonicalizedSubString(data, start, end, canonicalize);
} else {
valueOrLazySubstring =
new _LazySubstring(data, start, length, canonicalize);
}
}