abstract class Ven::Parselet::Share
- Ven::Parselet::Share
- Reference
- Object
Overview
Various methods and properties shared by the two parselet
kinds, Nud
and Led
.
Direct Known Subclasses
Defined in:
ven/parselet/share.crConstructors
-
.new(precedence : Ven::Precedence = Precedence::ZERO)
Makes a parselet with precedence precedence.
Instance Method Summary
-
#block(opening = true, semicolon : Bool = false)
Reads a block under the jurisdiction of this parselet.
-
#die(message : String)
Dies of
ReadError
given message, which should explain why the error happened. -
#led(precedence = @precedence)
Reads a led under the jurisdiction of this parselet, with the precedence of this parselet.
-
#precedence : Precedence
The precedence of this parselet (experimental for nuds).
-
#semicolon : Bool
Whether a semicolon must follow this parselet.
-
#symbol(tag, token = nil) : QSymbol
Reads a symbol if token is nil (orelse uses the value of token) and creates the corresponding symbol quote.
Macro Summary
-
if?(word, then consequtive, else alternative = nil)
Evaluates consequtive if read word; otherwise, evaluates alternative.
-
lexeme(token = token)
Returns the lexeme of token.
-
type(token = token)
Returns the type of token.
Constructor Detail
Makes a parselet with precedence precedence.
NOTE Having precedence is experimental for nuds.
Instance Method Detail
Reads a block under the jurisdiction of this parselet.
Returns the statements of the block.
If opening is false, the opening paren won't be read.
Dies of ReadError
given message, which should explain
why the error happened.
Reads a led under the jurisdiction of this parselet, with the precedence of this parselet.
Reads a symbol if token is nil (orelse uses the value of token) and creates the corresponding symbol quote.
Macro Detail
Evaluates consequtive if read word; otherwise, evaluates alternative.
Returns the lexeme of token.
token defaults to token
, which is the standard name
of the lead token in parse
.
Returns the type of token.
token defaults to token
, which is the standard name
of the lead token in parse
.