Class TemplateLiteralToken


public class TemplateLiteralToken extends LiteralToken
A token representing a javascript template literal substring.

The value of the Token is the raw string. The token also stores whether this token contains any error messages that should be passed to the parser due to invalid escapes or unnecessary escapes. The parser, not the scanner, reports these errors because the errors are suppressed in tagged template literals. The scanner does not know if it's in a tagged or untagged template lit.

  • Field Details

    • errorMessage

      public final @Nullable String errorMessage
    • errorPosition

      public final SourcePosition errorPosition
    • errorLevel

      public final com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken.ErrorLevel errorLevel
  • Constructor Details

    • TemplateLiteralToken

      public TemplateLiteralToken(TokenType type, String value, String errorMsg, com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken.ErrorLevel errorLevel, SourcePosition position, SourceRange location)
  • Method Details