Solid.Lexer (solid v1.0.0-rc.0)
View SourceLexer module for Solid. It is responsible for tokenizing the input text inside an object or a tag.
Summary
Functions
Tokenize the input text inside an object
Tokenize the input text as a complete tag
Tokenize the rest of the tag after the tag name
Tokenize the tag name for a tag
Types
@type column() :: pos_integer()
@type line() :: pos_integer()
@type operator() :: :== | :!= | :> | :>= | :< | :<= | :<> | :contains
@type special() ::
:dot
| :pipe
| :open_round
| :close_round
| :open_square
| :close_square
| :colon
| :comma
| :assignment
@type tokens() :: [token()]
Functions
@spec tokenize_object(Solid.ParserContext.t()) :: {:ok, tokens(), Solid.ParserContext.t()} | {:error, reason :: term(), rest :: binary(), loc()}
Tokenize the input text inside an object
@spec tokenize_tag( Solid.ParserContext.t(), keyword() ) :: {:ok, tag_name :: binary(), tokens(), Solid.ParserContext.t()} | {:liquid_tag, Solid.ParserContext.t()} | {:end_liquid_tag, Solid.ParserContext.t()} | {:error, reason :: term(), rest :: binary(), loc()} | {:error, :not_expected_tag}
Tokenize the input text as a complete tag
@spec tokenize_tag_end(Solid.ParserContext.t()) :: {:ok, tokens(), Solid.ParserContext.t()} | {:error, reason :: term(), rest :: binary(), loc()}
Tokenize the rest of the tag after the tag name
@spec tokenize_tag_start( Solid.ParserContext.t(), keyword() ) :: {:ok, tag_name :: binary(), Solid.ParserContext.t()} | {:liquid_tag, Solid.ParserContext.t()} | {:end_liquid_tag, Solid.ParserContext.t()} | {:error, reason :: term(), rest :: binary(), loc()} | {:error, :not_expected_tag}
Tokenize the tag name for a tag