LanguageVersionToken class Null safety

A specialized comment token representing a language version (e.g. '// @dart = 2.1').

Constructors

LanguageVersionToken.from(String text, int offset, int major, int minor)

Properties

beforeSynthetic Token?
The token before this synthetic token, or null if this is not a synthetic ), ], }, or > token.
read / writeinherited
charCount int
The number of characters parsed by this token.
read-onlyinherited
charEnd int
The character offset of the end of this token within the source text.
read-onlyinherited
charOffset int
The character offset of the start of this token within the source text.
read-onlyinherited
end int
Return the offset from the beginning of the file to the character after the last character of the syntactic entity.
read-onlyinherited
endGroup Token?
The token that corresponds to this token, or null if this token is not the first of a pair of matching tokens (such as parentheses).
read-onlyinherited
hashCode int
The hash code for this object.
read-onlyinherited
isEof bool
Return true if this token represents an end of file.
read-onlyinherited
isIdentifier bool
True if this token is an identifier. Some keywords allowed as identifiers, see implementation in KeywordToken.
read-onlyinherited
isKeyword bool
True if this token is a keyword. Some keywords allowed as identifiers, see implementation in KeywordToken.
read-onlyinherited
isKeywordOrIdentifier bool
True if this token is a keyword or an identifier.
read-onlyinherited
isModifier bool
Return true if this token is a modifier such as abstract or const.
read-onlyinherited
isOperator bool
Return true if this token represents an operator.
read-onlyinherited
isSynthetic bool
Return true if this token is a synthetic token. A synthetic token is a token that was introduced by the parser in order to recover from an error in the code.
read-onlyinherited
isTopLevelKeyword bool
Return true if this token is a keyword starting a top level declaration such as class, enum, import, etc.
read-onlyinherited
isUserDefinableOperator bool
Return true if this token represents an operator that can be defined by users.
read-onlyinherited
keyword Keyword?
Return the keyword, if a keyword token, or null otherwise.
read-onlyinherited
kind int
The kind enum of this token as determined by its type.
read-onlyinherited
length int
Return the number of characters in the syntactic entity's source range.
read-onlyinherited
lexeme String
Return the lexeme that represents this token.
read-onlyinherited
major int
The major language version.
final
minor int
The minor language version.
final
next Token?
Return the next token in the token stream.
read / writeinherited
offset int
The offset from the beginning of the file to the first character in the token.
read / writeinherited
parent ↔ SimpleToken?
The token that contains this comment.
read / writeinherited
precedingComments ↔ CommentToken?
Return the first comment in the list of comments that precede this token, or null if there are no comments preceding this token. Additional comments can be reached by following the token stream using next until null is returned.
read / writeinherited
previous Token?
The previous token in the token stream.
read / writeinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
stringValue String?
For symbol and keyword tokens, returns the string value represented by this token. For StringTokens this method returns null.
read-onlyinherited
type TokenType
The type of the token.
read-onlyinherited

Methods

matchesAny(List<TokenType> types) bool
Return true if this token has any one of the given types.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
setNext(Token token) Token
Set the next token in the token stream to the given token. This has the side-effect of setting this token to be the previous token for the given token. Return the token that was passed in.
inherited
setNextWithoutSettingPrevious(Token? token) Token?
Set the next token in the token stream to the given token without changing which token is the previous token for the given token. Return the token that was passed in.
inherited
toString() String
A string representation of this object.
inherited
value() String
Return the value of this token. For keyword tokens, this is the keyword associated with the token, for other tokens it is the lexeme associated with the token.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited