class

Pratt::BinaryOperatorParselet

Inherits Pratt::InfixParselet < Reference < Object

Generic infix parselet for a binary arithmetic operator. The only difference when parsing, "+", "-", "*", "/", and "^" is precedence and associativity, so we can use a single parselet class for all of those.

Constructors

new(m_precedence : Pratt::Precedence, m_is_right : Bool)
Source

Instance methods

m_precedence
Source
parse(parser : Parser, left : Expression, token : Token) : Expression
Source