Class TemplateLiteralToken
java.lang.Object
com.google.javascript.jscomp.parsing.parser.Token
com.google.javascript.jscomp.parsing.parser.LiteralToken
com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken
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 Summary
FieldsModifier and TypeFieldDescriptionfinal com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken.ErrorLevel
final @Nullable String
final SourcePosition
Fields inherited from class com.google.javascript.jscomp.parsing.parser.LiteralToken
value
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateLiteralToken
(TokenType type, String value, String errorMsg, com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken.ErrorLevel errorLevel, SourcePosition position, SourceRange location) -
Method Summary
Methods inherited from class com.google.javascript.jscomp.parsing.parser.Token
asIdentifier, asLiteral, asTemplateLiteral, getStart
-
Field Details
-
errorMessage
-
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
-
toString
- Overrides:
toString
in classLiteralToken
-
hasError
public boolean hasError()
-