Enum pomsky_syntax::error::Token
source · #[non_exhaustive]
pub enum Token {
Show 30 variants
Caret,
Dollar,
BWord,
Star,
Plus,
QuestionMark,
Pipe,
Colon,
OpenParen,
CloseParen,
OpenBrace,
CloseBrace,
Comma,
Not,
OpenBracket,
Dash,
CloseBracket,
Dot,
LookAhead,
LookBehind,
DoubleColon,
Semicolon,
Equals,
String,
CodePoint,
Number,
Identifier,
ReservedName,
ErrorMsg(LexErrorMsg),
Error,
}Expand description
A token encountered while lexing a pomsky expression.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Caret
^ (start boundary)
Dollar
$ (end boundary)
BWord
% (\b boundary)
Star
* (*? repetition)
Plus
+ (+? repetition)
QuestionMark
? (?? repetition)
Pipe
| (or)
Colon
: (capturing group start)
OpenParen
( (open group)
CloseParen
) (close group)
OpenBrace
{ (open repetition)
CloseBrace
} (close repetition)
Comma
, (comma in repetition)
Not
! (negation)
OpenBracket
[ (open character class)
Dash
- (unicode range)
CloseBracket
] (close character class)
Dot
. (any code point except newline)
LookAhead
>> (positive lookahead)
LookBehind
<< (positive lookbehind)
DoubleColon
:: (back reference)
Semicolon
; (delimits modifiers)
Equals
= (for assignments)
String
"Hello" or 'Hello' (Hello)
CodePoint
U+FFF03 (Unicode code point)
Number
12 (number in repetition)
Identifier
hello (capturing group name)
ReservedName
lazy (reserved name)
ErrorMsg(LexErrorMsg)
Illegal token for which we want to show a better error message
Error
Token representing an unknown character