@@ -1010,7 +1010,7 @@ impl Compiler {
10101010 fn compile_try_statement (
10111011 & mut self ,
10121012 body : & [ located_ast:: Stmt ] ,
1013- handlers : & [ located_ast:: Excepthandler ] ,
1013+ handlers : & [ located_ast:: ExceptHandler ] ,
10141014 orelse : & [ located_ast:: Stmt ] ,
10151015 finalbody : & [ located_ast:: Stmt ] ,
10161016 ) -> CompileResult < ( ) > {
@@ -1044,8 +1044,8 @@ impl Compiler {
10441044 self . switch_to_block ( handler_block) ;
10451045 // Exception is on top of stack now
10461046 for handler in handlers {
1047- let located_ast:: Excepthandler :: ExceptHandler (
1048- located_ast:: ExcepthandlerExceptHandler {
1047+ let located_ast:: ExceptHandler :: ExceptHandler (
1048+ located_ast:: ExceptHandlerExceptHandler {
10491049 type_, name, body, ..
10501050 } ,
10511051 ) = & handler;
@@ -1142,7 +1142,7 @@ impl Compiler {
11421142 fn compile_try_star_statement (
11431143 & mut self ,
11441144 _body : & [ located_ast:: Stmt ] ,
1145- _handlers : & [ located_ast:: Excepthandler ] ,
1145+ _handlers : & [ located_ast:: ExceptHandler ] ,
11461146 _orelse : & [ located_ast:: Stmt ] ,
11471147 _finalbody : & [ located_ast:: Stmt ] ,
11481148 ) -> CompileResult < ( ) > {
@@ -1499,7 +1499,7 @@ impl Compiler {
14991499
15001500 fn compile_with (
15011501 & mut self ,
1502- items : & [ located_ast:: Withitem ] ,
1502+ items : & [ located_ast:: WithItem ] ,
15031503 body : & [ located_ast:: Stmt ] ,
15041504 is_async : bool ,
15051505 ) -> CompileResult < ( ) > {
@@ -1641,7 +1641,7 @@ impl Compiler {
16411641 fn compile_chained_comparison (
16421642 & mut self ,
16431643 left : & located_ast:: Expr ,
1644- ops : & [ located_ast:: Cmpop ] ,
1644+ ops : & [ located_ast:: CmpOp ] ,
16451645 exprs : & [ located_ast:: Expr ] ,
16461646 ) -> CompileResult < ( ) > {
16471647 assert ! ( !ops. is_empty( ) ) ;
@@ -1651,19 +1651,19 @@ impl Compiler {
16511651
16521652 use bytecode:: ComparisonOperator :: * ;
16531653 use bytecode:: TestOperator :: * ;
1654- let compile_cmpop = |c : & mut Self , op : & located_ast:: Cmpop | match op {
1655- located_ast:: Cmpop :: Eq => emit ! ( c, Instruction :: CompareOperation { op: Equal } ) ,
1656- located_ast:: Cmpop :: NotEq => emit ! ( c, Instruction :: CompareOperation { op: NotEqual } ) ,
1657- located_ast:: Cmpop :: Lt => emit ! ( c, Instruction :: CompareOperation { op: Less } ) ,
1658- located_ast:: Cmpop :: LtE => emit ! ( c, Instruction :: CompareOperation { op: LessOrEqual } ) ,
1659- located_ast:: Cmpop :: Gt => emit ! ( c, Instruction :: CompareOperation { op: Greater } ) ,
1660- located_ast:: Cmpop :: GtE => {
1654+ let compile_cmpop = |c : & mut Self , op : & located_ast:: CmpOp | match op {
1655+ located_ast:: CmpOp :: Eq => emit ! ( c, Instruction :: CompareOperation { op: Equal } ) ,
1656+ located_ast:: CmpOp :: NotEq => emit ! ( c, Instruction :: CompareOperation { op: NotEqual } ) ,
1657+ located_ast:: CmpOp :: Lt => emit ! ( c, Instruction :: CompareOperation { op: Less } ) ,
1658+ located_ast:: CmpOp :: LtE => emit ! ( c, Instruction :: CompareOperation { op: LessOrEqual } ) ,
1659+ located_ast:: CmpOp :: Gt => emit ! ( c, Instruction :: CompareOperation { op: Greater } ) ,
1660+ located_ast:: CmpOp :: GtE => {
16611661 emit ! ( c, Instruction :: CompareOperation { op: GreaterOrEqual } )
16621662 }
1663- located_ast:: Cmpop :: In => emit ! ( c, Instruction :: TestOperation { op: In } ) ,
1664- located_ast:: Cmpop :: NotIn => emit ! ( c, Instruction :: TestOperation { op: NotIn } ) ,
1665- located_ast:: Cmpop :: Is => emit ! ( c, Instruction :: TestOperation { op: Is } ) ,
1666- located_ast:: Cmpop :: IsNot => emit ! ( c, Instruction :: TestOperation { op: IsNot } ) ,
1663+ located_ast:: CmpOp :: In => emit ! ( c, Instruction :: TestOperation { op: In } ) ,
1664+ located_ast:: CmpOp :: NotIn => emit ! ( c, Instruction :: TestOperation { op: NotIn } ) ,
1665+ located_ast:: CmpOp :: Is => emit ! ( c, Instruction :: TestOperation { op: Is } ) ,
1666+ located_ast:: CmpOp :: IsNot => emit ! ( c, Instruction :: TestOperation { op: IsNot } ) ,
16671667 } ;
16681668
16691669 // a == b == c == d
@@ -1951,7 +1951,7 @@ impl Compiler {
19511951 match & expression {
19521952 located_ast:: Expr :: BoolOp ( located_ast:: ExprBoolOp { op, values, .. } ) => {
19531953 match op {
1954- located_ast:: Boolop :: And => {
1954+ located_ast:: BoolOp :: And => {
19551955 if condition {
19561956 // If all values are true.
19571957 let end_block = self . new_block ( ) ;
@@ -1972,7 +1972,7 @@ impl Compiler {
19721972 }
19731973 }
19741974 }
1975- located_ast:: Boolop :: Or => {
1975+ located_ast:: BoolOp :: Or => {
19761976 if condition {
19771977 // If any of the values is true.
19781978 for value in values {
@@ -1996,7 +1996,7 @@ impl Compiler {
19961996 }
19971997 }
19981998 located_ast:: Expr :: UnaryOp ( located_ast:: ExprUnaryOp {
1999- op : located_ast:: Unaryop :: Not ,
1999+ op : located_ast:: UnaryOp :: Not ,
20002000 operand,
20012001 ..
20022002 } ) => {
@@ -2029,7 +2029,7 @@ impl Compiler {
20292029 /// This means, that the last value remains on the stack.
20302030 fn compile_bool_op (
20312031 & mut self ,
2032- op : & located_ast:: Boolop ,
2032+ op : & located_ast:: BoolOp ,
20332033 values : & [ located_ast:: Expr ] ,
20342034 ) -> CompileResult < ( ) > {
20352035 let after_block = self . new_block ( ) ;
@@ -2039,15 +2039,15 @@ impl Compiler {
20392039 self . compile_expression ( value) ?;
20402040
20412041 match op {
2042- located_ast:: Boolop :: And => {
2042+ located_ast:: BoolOp :: And => {
20432043 emit ! (
20442044 self ,
20452045 Instruction :: JumpIfFalseOrPop {
20462046 target: after_block,
20472047 }
20482048 ) ;
20492049 }
2050- located_ast:: Boolop :: Or => {
2050+ located_ast:: BoolOp :: Or => {
20512051 emit ! (
20522052 self ,
20532053 Instruction :: JumpIfTrueOrPop {
@@ -2122,10 +2122,10 @@ impl Compiler {
21222122
21232123 // Perform operation:
21242124 let op = match op {
2125- Unaryop :: UAdd => bytecode:: UnaryOperator :: Plus ,
2126- Unaryop :: USub => bytecode:: UnaryOperator :: Minus ,
2127- Unaryop :: Not => bytecode:: UnaryOperator :: Not ,
2128- Unaryop :: Invert => bytecode:: UnaryOperator :: Invert ,
2125+ UnaryOp :: UAdd => bytecode:: UnaryOperator :: Plus ,
2126+ UnaryOp :: USub => bytecode:: UnaryOperator :: Minus ,
2127+ UnaryOp :: Not => bytecode:: UnaryOperator :: Not ,
2128+ UnaryOp :: Invert => bytecode:: UnaryOperator :: Invert ,
21292129 } ;
21302130 emit ! ( self , Instruction :: UnaryOperation { op } ) ;
21312131 }
0 commit comments