Skip to content

Implement binary expressions #39

Description

@Seddryck

Implement binary expression syntax for the existing Expressif operators |AND, |OR, and |XOR.

Use a dedicated CST node:

BinaryExpressionSyntax
├── left: ExpressionSyntax
├── operator: BinaryOperatorSyntax
└── right: ExpressionSyntax

Examples:

foo |AND bar
foo |OR bar
foo |XOR bar
!foo |AND bar

Requirements:

  • preserve the concrete operator in the CST;
  • reuse ordinary expression syntax for both operands;
  • define and test associativity and precedence explicitly;
  • ensure unary negation binds more tightly than binary operators;
  • distinguish |AND, |OR, and |XOR from the ordinary | pipeline separator;
  • keep semantic validation out of the parser.

Add corpus tests for each operator, chained expressions, unary/binary composition, whitespace, malformed operators, missing operands, and CST shape.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions