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

Issue 10387080: Accept more labels per switch case. (Closed)

Created:
8 years, 7 months ago by Lasse Reichstein Nielsen
Modified:
8 years, 7 months ago
Reviewers:
ahe, karlklose
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Accept more labels per switch case. This matches the new, disambiguated switch syntax. Committed: https://code.google.com/p/dart/source/detail?r=7601

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address some review comments. Still a few bugs left. #

Patch Set 3 : Fix (last?) bugs. #

Patch Set 4 : Remove debug-print. #

Total comments: 16

Patch Set 5 : Fix bug when there are more than one label on a statement. #

Total comments: 7

Patch Set 6 : Extracted parseSwitchCase #

Patch Set 7 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -105 lines) Patch
M frog/tests/leg_only/switch_test.dart View 1 2 3 4 5 6 1 chunk +54 lines, -0 lines 0 comments Download
M lib/compiler/implementation/resolver.dart View 1 2 3 4 5 6 5 chunks +21 lines, -7 lines 0 comments Download
M lib/compiler/implementation/scanner/listener.dart View 1 2 3 4 5 6 6 chunks +21 lines, -13 lines 0 comments Download
M lib/compiler/implementation/scanner/parser.dart View 1 2 3 4 5 6 2 chunks +60 lines, -32 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 4 chunks +29 lines, -13 lines 0 comments Download
M lib/compiler/implementation/ssa/tracer.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/tree/nodes.dart View 1 7 chunks +33 lines, -31 lines 0 comments Download
M lib/compiler/implementation/tree/unparser.dart View 1 2 chunks +8 lines, -9 lines 0 comments Download
M lib/compiler/implementation/tree/visitors.dart View 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/typechecker.dart View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Lasse Reichstein Nielsen
8 years, 7 months ago (2012-05-11 09:13:28 UTC) #1
karlklose
https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart File frog/tests/leg_only/switch_test.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart#newcode60 frog/tests/leg_only/switch_test.dart:60: // Tests some badly formed switch bodies. Tests -> ...
8 years, 7 months ago (2012-05-11 09:29:31 UTC) #2
Lasse Reichstein Nielsen
Peter, please take another look. https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart File frog/tests/leg_only/switch_test.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart#newcode60 frog/tests/leg_only/switch_test.dart:60: // Tests some badly ...
8 years, 7 months ago (2012-05-11 14:17:09 UTC) #3
Lasse Reichstein Nielsen
Peter, please take another look. https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart File frog/tests/leg_only/switch_test.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/1/frog/tests/leg_only/switch_test.dart#newcode60 frog/tests/leg_only/switch_test.dart:60: // Tests some badly ...
8 years, 7 months ago (2012-05-11 14:17:09 UTC) #4
Lasse Reichstein Nielsen
I changed the SwitchCase to have a single list of both labels and case-expressions. It ...
8 years, 7 months ago (2012-05-11 14:27:52 UTC) #5
ahe
LGTM! https://chromiumcodereview.appspot.com/10387080/diff/9001/frog/tests/leg_only/switch_test.dart File frog/tests/leg_only/switch_test.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/9001/frog/tests/leg_only/switch_test.dart#newcode36 frog/tests/leg_only/switch_test.dart:36: break fubar; That is a cuss word. It ...
8 years, 7 months ago (2012-05-14 09:24:25 UTC) #6
ahe
A few follow comments on the parser changes. https://chromiumcodereview.appspot.com/10387080/diff/6013/lib/compiler/implementation/scanner/parser.dart File lib/compiler/implementation/scanner/parser.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/6013/lib/compiler/implementation/scanner/parser.dart#newcode1618 lib/compiler/implementation/scanner/parser.dart:1618: while ...
8 years, 7 months ago (2012-05-14 09:31:24 UTC) #7
Lasse Reichstein Nielsen
https://chromiumcodereview.appspot.com/10387080/diff/9001/frog/tests/leg_only/switch_test.dart File frog/tests/leg_only/switch_test.dart (right): https://chromiumcodereview.appspot.com/10387080/diff/9001/frog/tests/leg_only/switch_test.dart#newcode36 frog/tests/leg_only/switch_test.dart:36: break fubar; Or "beyond all repair", even. Will change. ...
8 years, 7 months ago (2012-05-14 10:34:57 UTC) #8
ahe
8 years, 7 months ago (2012-05-14 10:44:09 UTC) #9
https://chromiumcodereview.appspot.com/10387080/diff/6013/lib/compiler/implem...
File lib/compiler/implementation/scanner/parser.dart (right):

https://chromiumcodereview.appspot.com/10387080/diff/6013/lib/compiler/implem...
lib/compiler/implementation/scanner/parser.dart:1620: if (value === 'case' ||
value === 'default' ||
On 2012/05/14 10:34:58, Lasse Reichstein Nielsen wrote:
> Done.
> Maybe putting them on separate lines is better?
> I find it harder to read with too many parentheses.

Seriously: I do not understand what it means. This is not about readability, I
do not understand the code without parentheses.

Powered by Google App Engine
This is Rietveld 408576698