Current section
Files
Jump to
Current section
Files
src/yamleam@token.erl
-module(yamleam@token).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/yamleam/token.gleam").
-export_type([token_kind/0, token/0, line/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Token type emitted by the lexer.\n"
"\n"
" yamleam v0.1 uses a line-oriented lexer: each logical (non-blank,\n"
" non-comment) line is converted into a list of tokens together with\n"
" the line's indent column. The parser consumes these line-token groups.\n"
).
-type token_kind() :: {plain_scalar, binary()} |
{quoted_scalar, binary()} |
colon |
dash |
document_start |
document_end |
flow_seq_start |
flow_seq_end |
flow_map_start |
flow_map_end |
comma |
{anchor_marker, binary()} |
{alias_marker, binary()}.
-type token() :: {token, token_kind(), yamleam@position:position()}.
-type line() :: {line, integer(), integer(), list(token())}.