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 Detail

      • errorMessage

        @Nullable
        public final java.lang.String errorMessage
      • errorLevel

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

      • TemplateLiteralToken

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

      • hasError

        public boolean hasError()