Create expression2 precendence level (relation operators)
This commit is contained in:
@@ -8,10 +8,12 @@ from smnp.token.type import TokenType
|
||||
class Expression(Valuable):
|
||||
pass
|
||||
|
||||
|
||||
ExpressionParser = Parser.leftAssociativeOperatorParser(TermParser, [TokenType.PLUS, TokenType.MINUS], TermParser,
|
||||
lambda left, op, right: Expression.withValue(BinaryOperator.withValues(left, op, right)))
|
||||
|
||||
Expression2Parser = Parser.leftAssociativeOperatorParser(ExpressionParser, [TokenType.RELATION], ExpressionParser,
|
||||
lambda left, op, right: Expression.withValue(BinaryOperator.withValues(left, op, right)))
|
||||
|
||||
#
|
||||
# class ExpressionNode(Node):
|
||||
# def __init__(self, pos):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from smnp.ast.node.expression import ExpressionParser
|
||||
from smnp.ast.node.expression import Expression2Parser
|
||||
from smnp.ast.node.model import Node, ParseResult
|
||||
from smnp.ast.parser import Parser
|
||||
|
||||
@@ -15,7 +15,7 @@ def parse(input):
|
||||
|
||||
|
||||
#TODO -> temporary (to remove):
|
||||
ExpressionParser
|
||||
Expression2Parser
|
||||
)(input)
|
||||
|
||||
if result.result:
|
||||
|
||||
Reference in New Issue
Block a user