D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3612 - ExpressionList is undefined
Summary: ExpressionList is undefined
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL: http://digitalmars.com/d/2.0/statemen...
Keywords: spec
Depends on:
Blocks:
 
Reported: 2009-12-12 10:54 UTC by Jerry Quinn
Modified: 2015-06-09 01:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2009-12-12 10:54:42 UTC
CaseStatement is currently written as

CaseStatement:
	case ExpressionList : Statement

Here the grammar refers to ExpressionList, described as a ',' separated list of Expression.  However, Expression is a ',' separated list of AssignExpression.  So this is highly ambiguous.  There's no way from the description to distinguish between AssignExpressions that should be evaluated and ignored, and cases to be handled.

If we define:

ExpressionList:
        AssignExpression
        AssignExpression , ExpressionList

then the problem goes away.  The text should be adjusted to match.
Comment 1 Leandro Lucarella 2009-12-14 06:30:25 UTC
http://www.dsource.org/projects/phobos/changeset/1375
Comment 2 Walter Bright 2009-12-31 11:17:07 UTC
Fixed dmd 1.054 and 2.038