grammar: introduce bitwise ops & shifts; retire legacy >> ARROW
- Tokenizer: add tokens for << >> & | ^ (SHIFT_LEFT/RIGHT, BIT_AND/OR/XOR); keep ||, &&, |> - Parser: precedence layers for bit ops (| ^ &) and shift (<< >>); remove >> Arrow production - AST: add BitAnd/BitOr/BitXor/Shr with Display - MIR builder: map bit ops and Shr to MIR BinaryOp - Interpreter: implement integer-only bit ops and shifts, mask shift count to 0..63 Compatibility: legacy >> Arrow removed from parser; use |> for pipeline.
This commit is contained in:
@ -333,7 +333,11 @@ pub enum BinaryOperator {
|
||||
Multiply,
|
||||
Divide,
|
||||
Modulo,
|
||||
BitAnd,
|
||||
BitOr,
|
||||
BitXor,
|
||||
Shl, // << shift-left (Phase 1)
|
||||
Shr,
|
||||
Equal,
|
||||
NotEqual,
|
||||
Less,
|
||||
@ -362,7 +366,11 @@ impl fmt::Display for BinaryOperator {
|
||||
BinaryOperator::Multiply => "*",
|
||||
BinaryOperator::Divide => "/",
|
||||
BinaryOperator::Modulo => "%",
|
||||
BinaryOperator::BitAnd => "&",
|
||||
BinaryOperator::BitOr => "|",
|
||||
BinaryOperator::BitXor => "^",
|
||||
BinaryOperator::Shl => "<<",
|
||||
BinaryOperator::Shr => ">>",
|
||||
BinaryOperator::Equal => "==",
|
||||
BinaryOperator::NotEqual => "!=",
|
||||
BinaryOperator::Less => "<",
|
||||
|
||||
Reference in New Issue
Block a user