ExpressionParser
ExpressionParser is a subparser that parses an expression. The following properties are used to detect the end of an expression:
- expression_indent: the indent of the first token in the expression
- a token with indent not greater than this ends the expression
- line_indent: the actual indent of the current line
- this becomes the block_indent of the next
if,for, orwhileblock
- this becomes the block_indent of the next
Constructors
Instance methods
compress
Sourceexpecting
Sourceexpression_done?
Given the stop conditions of the current sub-parser, return whether or not the next token will force the sub-parser is forced to stop.
expression_indent
Sourcehandle_dot
Sourcelast_term
Sourcelast_term!
Sourceoperators
Sourceparse
Sourcepop_term!
Sourceread_operand
Sourceread_operator
Reads the next operator and pushes it onto the stack, then moves on to the operand Peek the next token, and if it ends the expression, leave it there and return
stop
Sourceterms
Source