Fexpr::Scanner
Reads and tokenizes filter expression text into a stream of tokens.
The scanner processes input character by character, recognizing tokens like:
- Identifiers (e.g., name, age, @timestamp)
- Numbers (e.g., 42, -1.5)
- Quoted text (e.g., "crystal", 'v1.0')
- Operators (e.g., =, !=, &&, ||)
- Groups (expressions in parentheses)
- Comments (starting with //)
Constants
IDENTIFIER_REGEX = /^[\@\#\_]?[\w\.\:]*\w+$/
Regular expression for a valid identifier.
Constructors
Instance methods
Checks if a character is a valid start of a group/parenthesis.
Checks if a character is a valid first character of an identifier.
Checks if a character is a valid start of a join type operator.
Checks if a character is a valid first character of a number.
reader
Sourcescan
Returns the next token from the input stream.
If an error occurs during scanning, the returned TokenResult will contain an error message explaining what went wrong.
Checks if a character is a valid first character of a quoted text.