Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: lib/src/source_visitor.dart

Issue 846133002: Put conditional operators on the left. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Update version. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source_visitor.dart
diff --git a/lib/src/source_visitor.dart b/lib/src/source_visitor.dart
index 93fc4661a6d1d6fc69686faf22611943647fd767..c699bec12639c36adf555a9c7acc77a867509bc0 100644
--- a/lib/src/source_visitor.dart
+++ b/lib/src/source_visitor.dart
@@ -371,19 +371,21 @@ class SourceVisitor implements AstVisitor {
visitConditionalExpression(ConditionalExpression node) {
_writer.nestExpression();
visit(node.condition);
- space();
_writer.startSpan();
- token(node.question);
// If we split after one clause in a conditional, always split after both.
_writer.startMultisplit();
_writer.multisplit(nest: true, space: true);
+ token(node.question);
+ space();
+
visit(node.thenExpression);
- space();
- token(node.colon);
_writer.multisplit(nest: true, space: true);
+ token(node.colon);
+ space();
+
visit(node.elseExpression);
_writer.endMultisplit();
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698