diff --git a/lib/src/front_end/ast_node_visitor.dart b/lib/src/front_end/ast_node_visitor.dart index dd2dc2ff..45f8a3f0 100644 --- a/lib/src/front_end/ast_node_visitor.dart +++ b/lib/src/front_end/ast_node_visitor.dart @@ -116,7 +116,7 @@ class AstNodeVisitor extends ThrowingAstVisitor @override void visitBooleanLiteral(BooleanLiteral node) { - throw UnimplementedError(); + token(node.literal); } @override diff --git a/test/expression/logical.stmt b/test/expression/logical.stmt new file mode 100644 index 00000000..d30c2f3b --- /dev/null +++ b/test/expression/logical.stmt @@ -0,0 +1,42 @@ +40 columns | +>>> Unsplit mixed. +true||false&&true||false&&false; +<<< +true || false && true || false && false; +>>> If any `&&` operator splits, they all do. +operand1 && operand2 && operand3 && operand4; +<<< +operand1 && + operand2 && + operand3 && + operand4; +>>> If any `||` operator splits, they all do. +operand1 || operand2 || operand3 || operand4; +<<< +operand1 || + operand2 || + operand3 || + operand4; +>>> Prefer to split `||` over `&&`. +operand1 || operand2 && operand3 || operand4; +<<< +operand1 || + operand2 && operand3 || + operand4; +>>> +operand1 && operand2 || operand3 && operand4; +<<< +operand1 && operand2 || + operand3 && operand4; +>>> Mix `&&` with other binary operators. +operand1 > operand2 && operand3 == operand4 && operand5 + operand6; +<<< +operand1 > operand2 && + operand3 == operand4 && + operand5 + operand6; +>>> Mix `||` with other binary operators. +operand1 > operand2 || operand3 == operand4 || operand5 + operand6; +<<< +operand1 > operand2 || + operand3 == operand4 || + operand5 + operand6; \ No newline at end of file