17#ifndef A11_FLOW_TOKEN_H_
18#define A11_FLOW_TOKEN_H_
25#include <absl/time/time.h>
Definition catalogue.cc:29
TokenKind KindFromName(std::string_view name)
The kind a name from [KindName] refers to, or kBad if it is not one.
@ kBad
Something the language has no meaning for.
std::string_view KindName(TokenKind kind)
The name of a kind, as a11.flow.lexer spells it.
@ kCarry
What a repeat carries.
TokenKind
What kind of thing a token is.
Definition token.h:37
@ kScope
Static namespace qualification, distinct from runtime projection.
@ kRange
.. – the range between two bounds, either of which may be left out.
@ kEnd
One past the last token, so lookahead never runs off the end.
@ kWord
A bare word. What it means is the grammar's business, not the lexer's.
@ kNewline
The end of a statement. One per run of blank lines, never leading.
@ kSpread
... or ... – everything the thing after it holds, spread in here.
The source range of an escape inside a string token.
Definition token.h:93
size_t start
Definition token.h:94
int line
Definition token.h:96
size_t end
Definition token.h:95
int column
Definition token.h:97
One token: what it is, where it is, and what it holds.
Definition token.h:104
size_t start
Definition token.h:108
int line
1-based, as a11.flow.lexer has always reported them.
Definition token.h:111
std::vector< StringEscape > string_escapes
Escape ranges before multiline indentation is removed.
Definition token.h:117
bool IsWord() const
Definition token.h:126
int column
Definition token.h:112
long long integer
Definition token.h:121
bool is_integer
Definition token.h:122
std::string_view text
The source slice, exactly as written.
Definition token.h:107
bool EndsStatement() const
Whether this token ends a statement.
Definition token.h:129
size_t end
Definition token.h:109
std::string string_value
A kString's value, with escapes resolved.
Definition token.h:115
double number
A kNumber's value.
Definition token.h:120
absl::Duration duration
A kDuration's value.
Definition token.h:124
TokenKind kind
Definition token.h:105