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

Side by Side Diff: tools/gn/format_test_data/057.golden

Issue 772663002: gn format: Make parenthesizing better (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « tools/gn/format_test_data/057.gn ('k') | tools/gn/format_test_data/058.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 80 ---------------------------------------------------------------------------
2 # Because there is a difference in precedence level between || and &&
3 # a || b || c && d
4 # is equivalent to
5 # a || b || (c && d)
6 # Because parens are not stored in the parse tree, the formatter recreates the
7 # minimally required set to maintain meaning. However, this particular case can
8 # be confusing for human readers, so we special case these ones and add
9 # strictly-unnecessary parens.
10
11 supports_android = is_apk || is_android_resources ||
12 (is_java_library && defined(invoker.supports_android) &&
13 invoker.supports_android)
14
15 enable_one_click_signin = is_win || is_mac || (is_linux && !is_chromeos)
16 enable_one_click_signin = (is_linux && !is_chromeos) || is_win || is_mac
17
18 x = c || (a && b)
19 x = (a && b) || c
20 x = (a && b) || c
21
22 x = c && (a || b)
23 x = (a || b) && c
24 x = a || (b && c)
OLDNEW
« no previous file with comments | « tools/gn/format_test_data/057.gn ('k') | tools/gn/format_test_data/058.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698