Mint::Parser
Inherits Mint::Helpers < Mint::Warnable < Reference < Object
Constants
These are the supported operators with their precedences.
Constructors
Class methods
Instance methods
Parses any number of ascii latters or numbers.
Parses any number of ascii uppercase latters, numbers or underscore and must start with an uppercase letter.
Parses a block surrounded by brackets.
Consumes characters while the yielded value is in one of the given characters.
The input which is an array of characters because this way it's faster in cases where the original code contains multi-byte characters.
Consumes a word and saves it as a keyword for syntax highlighting.
Parses a list of things, which ends in the terminator character and are separated by the separator character.
Parse many things separated by whitespace.
Parses an operation, switching the operands if the precedence of the next operation is higher than the current one. The precedences can be found in the operator parser file.
Operations can be chained recursively with this method as seen below.
Parses a thing (an ast node). Yielding the start position so the thing getting parsed can use it. If the block returns nil or we rollback to the start position since it means the parsing has failed. track - if true we save the resulting node
This method rolls up an operation where the operator is "|>" into a single call. Every other operation is passed trough.
Parses a raw part of the input until we reach the terminator or an interpolation (if it's needed).
Parses a raw part of the input until we reach the terminator or an interpolation.
Consumes all available whitespace and returns true / false whether there were any.