Pretokens

Each pretoken has an extent, which is a sequence of characters taken from the input.

Each pretoken has a kind, and possibly also some attributes, as described in the tables below.

KindAttributes
Reserved
Whitespace
LineCommentcomment content
BlockCommentcomment content
Punctuationmark
Identifieridentifier
RawIdentifieridentifier
LifetimeOrLabelname
RawLifetimeOrLabelname
SingleQuotedLiteralprefix, literal content, suffix
DoubleQuotedLiteralprefix, literal content, suffix
RawDoubleQuotedLiteralprefix, literal content, suffix
IntegerLiteralbase, digits, suffix
FloatLiteralbody, suffix

These attributes have the following types:

AttributeType
basebinary / octal / decimal / hexadecimal
bodysequence of characters
comment contentsequence of characters
digitssequence of characters
identifiersequence of characters
literal contentsequence of characters
marksingle character
namesequence of characters
prefixsequence of characters
suffixeither a sequence of characters or none