@@ -954,13 +954,8 @@ pub const Tokenizer = struct {
954
954
955
955
// Ampersand (&)
956
956
'&' = > {
957
- if (self .cursor .peekAt (1 ) == '&' ) {
958
- self .cursor .pos += 2 ;
959
- self .output .pushTokenNormal (.OpAnd , start , 2 );
960
- } else {
961
- self .cursor .pos += 1 ;
962
- self .output .pushTokenNormal (.OpAmpersand , start , 1 );
963
- }
957
+ self .cursor .pos += 1 ;
958
+ self .output .pushTokenNormal (.OpAmpersand , start , 1 );
964
959
},
965
960
966
961
// Comma (,)
@@ -982,10 +977,7 @@ pub const Tokenizer = struct {
982
977
983
978
// Pipe (|)
984
979
'|' = > {
985
- if (self .cursor .peekAt (1 ) == '|' ) {
986
- self .cursor .pos += 2 ;
987
- self .output .pushTokenNormal (.OpOr , start , 2 );
988
- } else if (self .cursor .peekAt (1 ) == '>' ) {
980
+ if (self .cursor .peekAt (1 ) == '>' ) {
989
981
self .cursor .pos += 2 ;
990
982
self .output .pushTokenNormal (.OpPizza , start , 2 );
991
983
} else {
@@ -1620,15 +1612,10 @@ fn rebuildBufferForTesting(buf: []const u8, tokens: *TokenizedBuffer, alloc: std
1620
1612
try buf2 .append (alloc , '!' );
1621
1613
},
1622
1614
.OpAnd = > {
1623
- std .debug .assert (length == 2 or length == 3 );
1624
- if (length == 2 ) {
1625
- try buf2 .append (alloc , '&' );
1626
- try buf2 .append (alloc , '&' );
1627
- } else {
1628
- try buf2 .append (alloc , 'a' );
1629
- try buf2 .append (alloc , 'n' );
1630
- try buf2 .append (alloc , 'd' );
1631
- }
1615
+ std .debug .assert (length == 3 );
1616
+ try buf2 .append (alloc , 'a' );
1617
+ try buf2 .append (alloc , 'n' );
1618
+ try buf2 .append (alloc , 'd' );
1632
1619
},
1633
1620
.OpAmpersand = > {
1634
1621
std .debug .assert (length == 1 );
@@ -1645,13 +1632,8 @@ fn rebuildBufferForTesting(buf: []const u8, tokens: *TokenizedBuffer, alloc: std
1645
1632
},
1646
1633
.OpOr = > {
1647
1634
std .debug .assert (length == 2 );
1648
- if (buf [token .offset ] == 'o' ) {
1649
- try buf2 .append (alloc , 'o' );
1650
- try buf2 .append (alloc , 'r' );
1651
- } else {
1652
- try buf2 .append (alloc , '|' );
1653
- try buf2 .append (alloc , '|' );
1654
- }
1635
+ try buf2 .append (alloc , 'o' );
1636
+ try buf2 .append (alloc , 'r' );
1655
1637
},
1656
1638
.OpBar = > {
1657
1639
std .debug .assert (length == 1 );
0 commit comments