StringTokenImpl.fromString constructor

StringTokenImpl.fromString(
  1. TokenType type,
  2. String value,
  3. int charOffset, {
  4. bool canonicalize = false,
  5. CommentToken? precedingComments,
})

Creates a non-lazy string token. If canonicalize is true, the string is canonicalized before the token is created.

Implementation

StringTokenImpl.fromString(TokenType type, String value, int charOffset,
    {bool canonicalize = false, CommentToken? precedingComments})
    : valueOrLazySubstring =
          canonicalize ? canonicalizedString(value) : value,
      super(type, charOffset, precedingComments);