grammar: add '<<' shift-left safely (Phase 1); map to AST/MIR/VM; keep '>>' as legacy ARROW
- Tokenizer: add SHIFT_LEFT for '<<' (before <= detection) - Parser: introduce parse_shift() layer; left-associative; only '<<' handled in Phase 1 - AST: add BinaryOperator::Shl and display - MIR builder: map Shl -> BinaryOp::Shl - Interpreter: implement Shl in both execution paths (integer-only, type error otherwise) No change to '>>' (legacy ARROW remains). No runtime gate yet for SHL as it does not collide with existing syntax.
This commit is contained in:
@ -114,6 +114,7 @@ impl super::MirBuilder {
|
||||
BinaryOperator::Multiply => Ok(BinaryOpType::Arithmetic(BinaryOp::Mul)),
|
||||
BinaryOperator::Divide => Ok(BinaryOpType::Arithmetic(BinaryOp::Div)),
|
||||
BinaryOperator::Modulo => Ok(BinaryOpType::Arithmetic(BinaryOp::Mod)),
|
||||
BinaryOperator::Shl => Ok(BinaryOpType::Arithmetic(BinaryOp::Shl)),
|
||||
BinaryOperator::Equal => Ok(BinaryOpType::Comparison(CompareOp::Eq)),
|
||||
BinaryOperator::NotEqual => Ok(BinaryOpType::Comparison(CompareOp::Ne)),
|
||||
BinaryOperator::Less => Ok(BinaryOpType::Comparison(CompareOp::Lt)),
|
||||
|
||||
Reference in New Issue
Block a user