pub enum Token {
Show 131 variants
Error,
PropertyExternal,
PropertyByRef,
PropertyConstant,
PropertySized,
KeywordProgram,
KeywordClass,
KeywordEndClass,
KeywordExtends,
KeywordImplements,
KeywordInterface,
KeywordEndInterface,
KeywordVarInput,
KeywordVarOutput,
KeywordVar,
KeywordVarConfig,
KeywordAbstract,
KeywordFinal,
KeywordMethod,
KeywordEndMethod,
KeywordSuper,
KeywordThis,
KeywordPropertyGet,
KeywordPropertySet,
KeywordEndProperty,
KeywordConstant,
KeywordRetain,
KeywordNonRetain,
KeywordVarTemp,
KeywordAccessPublic,
KeywordAccessPrivate,
KeywordAccessInternal,
KeywordAccessProtected,
KeywordOverride,
KeywordVarGlobal,
KeywordVarInOut,
KeywordVarExternal,
KeywordEndVar,
KeywordEndProgram,
KeywordFunction,
KeywordEndFunction,
KeywordFunctionBlock,
KeywordEndFunctionBlock,
KeywordType,
KeywordStruct,
KeywordEndType,
KeywordEndStruct,
KeywordActions,
KeywordAction,
KeywordEndAction,
KeywordEndActions,
KeywordColon,
KeywordSemicolon,
KeywordAssignment,
KeywordOutputAssignment,
KeywordReferenceAssignment,
KeywordParensOpen,
KeywordParensClose,
KeywordSquareParensOpen,
KeywordSquareParensClose,
KeywordComma,
KeywordDotDotDot,
KeywordDotDot,
KeywordDot,
KeywordIf,
KeywordThen,
KeywordElseIf,
KeywordElse,
KeywordEndIf,
KeywordFor,
KeywordTo,
KeywordBy,
KeywordDo,
KeywordEndFor,
KeywordWhile,
KeywordEndWhile,
KeywordRepeat,
KeywordUntil,
KeywordEndRepeat,
KeywordCase,
KeywordReturn,
KeywordExit,
KeywordContinue,
KeywordPointer,
KeywordFunctionPointer,
KeywordRef,
KeywordReferenceTo,
KeywordArray,
KeywordString,
KeywordWideString,
KeywordOf,
KeywordAt,
KeywordEndCase,
OperatorPlus,
OperatorMinus,
OperatorMultiplication,
OperatorExponent,
OperatorDivision,
OperatorEqual,
OperatorNotEqual,
OperatorLess,
OperatorGreater,
OperatorLessOrEqual,
OperatorGreaterOrEqual,
OperatorAmp,
OperatorDeref,
OperatorModulo,
OperatorAndThen,
OperatorAnd,
OperatorOrElse,
OperatorOr,
OperatorXor,
OperatorNot,
Identifier,
LiteralIntegerHex,
LiteralIntegerOct,
LiteralIntegerBin,
LiteralInteger,
LiteralNull,
LiteralTrue,
LiteralFalse,
LiteralDate,
LiteralDateAndTime,
LiteralTimeOfDay,
LiteralTime,
DirectAccess(DirectAccessType),
HardwareAccess((HardwareAccessType, DirectAccessType)),
LiteralString,
LiteralWideString,
TypeCastPrefix,
End,
}Variants§
Error
PropertyExternal
PropertyByRef
PropertyConstant
PropertySized
KeywordProgram
KeywordClass
KeywordEndClass
KeywordExtends
KeywordImplements
KeywordInterface
KeywordEndInterface
KeywordVarInput
KeywordVarOutput
KeywordVar
KeywordVarConfig
KeywordAbstract
KeywordFinal
KeywordMethod
KeywordEndMethod
KeywordSuper
KeywordThis
KeywordPropertyGet
KeywordPropertySet
KeywordEndProperty
KeywordConstant
KeywordRetain
KeywordNonRetain
KeywordVarTemp
KeywordAccessPublic
KeywordAccessPrivate
KeywordAccessInternal
KeywordAccessProtected
KeywordOverride
KeywordVarGlobal
KeywordVarInOut
KeywordVarExternal
KeywordEndVar
KeywordEndProgram
KeywordFunction
KeywordEndFunction
KeywordFunctionBlock
KeywordEndFunctionBlock
KeywordType
KeywordStruct
KeywordEndType
KeywordEndStruct
KeywordActions
KeywordAction
KeywordEndAction
KeywordEndActions
KeywordColon
KeywordSemicolon
KeywordAssignment
KeywordOutputAssignment
KeywordReferenceAssignment
KeywordParensOpen
KeywordParensClose
KeywordSquareParensOpen
KeywordSquareParensClose
KeywordComma
KeywordDotDotDot
KeywordDotDot
KeywordDot
KeywordIf
KeywordThen
KeywordElseIf
KeywordElse
KeywordEndIf
KeywordFor
KeywordTo
KeywordBy
KeywordDo
KeywordEndFor
KeywordWhile
KeywordEndWhile
KeywordRepeat
KeywordUntil
KeywordEndRepeat
KeywordCase
KeywordReturn
KeywordExit
KeywordContinue
KeywordPointer
KeywordFunctionPointer
KeywordRef
KeywordReferenceTo
KeywordArray
KeywordString
KeywordWideString
KeywordOf
KeywordAt
KeywordEndCase
OperatorPlus
OperatorMinus
OperatorMultiplication
OperatorExponent
OperatorDivision
OperatorEqual
OperatorNotEqual
OperatorLess
OperatorGreater
OperatorLessOrEqual
OperatorGreaterOrEqual
OperatorAmp
OperatorDeref
OperatorModulo
OperatorAndThen
OperatorAnd
OperatorOrElse
OperatorOr
OperatorXor
OperatorNot
Identifier
LiteralIntegerHex
LiteralIntegerOct
LiteralIntegerBin
LiteralInteger
LiteralNull
LiteralTrue
LiteralFalse
LiteralDate
LiteralDateAndTime
LiteralTimeOfDay
LiteralTime
DirectAccess(DirectAccessType)
HardwareAccess((HardwareAccessType, DirectAccessType))
LiteralString
LiteralWideString
TypeCastPrefix
End
Implementations§
Source§impl Token
impl Token
Sourcepub fn is_identifier_like(&self) -> bool
pub fn is_identifier_like(&self) -> bool
Returns true if the current token can be used where an identifier is expected.
PROPERTY_GET and PROPERTY_SET are soft keywords: they are parsed as property accessors in
property declarations, but may still be used as identifiers elsewhere.
Sourcepub fn classes(&self) -> &'static [TokenClass]
pub fn classes(&self) -> &'static [TokenClass]
Linguistic classification of this token, returned as a slice so a token can carry more than one class. Empty when nothing currently classifies the token.
Trait Implementations§
Source§impl<'s> Logos<'s> for Token
impl<'s> Logos<'s> for Token
Source§type Extras = ()
type Extras = ()
Associated type
Extras for the particular lexer. This can be set using
#[logos(extras = MyExtras)] and accessed inside callbacks.Source§type Source = str
type Source = str
Source type this token can be lexed from. This will default to
str,
unless one of the defined patterns explicitly uses non-unicode byte values
or byte slices, in which case that implementation will use [u8].Source§fn lex(lex: &mut Lexer<'s, Self>)
fn lex(lex: &mut Lexer<'s, Self>)
The heart of Logos. Called by the
Lexer. The implementation for this function
is generated by the logos-derive crate.impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more