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
-
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 Summary
Fields Modifier and Type Field Description com.google.javascript.jscomp.parsing.parser.TemplateLiteralToken.ErrorLevelerrorLevel@Nullable java.lang.StringerrorMessageSourcePositionerrorPosition-
Fields inherited from class com.google.javascript.jscomp.parsing.parser.LiteralToken
value
-
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasError()java.lang.StringtoString()-
Methods inherited from class com.google.javascript.jscomp.parsing.parser.Token
asIdentifier, asLiteral, asTemplateLiteral, getStart
-
-
-
-
Field Detail
-
errorMessage
public final @Nullable java.lang.String errorMessage
-
errorPosition
public final SourcePosition errorPosition
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classLiteralToken
-
hasError
public boolean hasError()
-
-