Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: X10 2.1.0
-
Fix Version/s: X10 2.3.2
-
Component/s: X10 Compiler: Front-end Parser
-
Labels:None
-
Number of attachments :
Description
In x10.g we have:
Statement ::= AnnotationStatement
| ExpressionStatement
And the rules relevant to expressions with annotations are:
UnaryExpression ::= UnannotatedUnaryExpression
| Annotations UnannotatedUnaryExpression
First, it doesn't make sense to me how the parser thinks that:
@Ann (2+4)
is an annotation on an UnannotatedUnaryExpression!
Second, we get a parsing error for:
interface Ann extends MethodAnnotation, ClassAnnotation, FieldAnnotation, ImportAnnotation, PackageAnnotation, TypeAnnotation, ExpressionAnnotation, StatementAnnotation {} class Test { def m(Any)=1; def test() { m(@Ann m(2));// ok @Ann m(2); // todo: it should parse! } } C:\cygwin\home\Yoav\test\Hello.x10:4,15-34 Message: Syntax Error: Syntax error: Token "*" expected instead of this input Position: C:\cygwin\home\Yoav\test\Hello.x10:5,25-26 Message: Syntax Error: Syntax error: Token "PackageDeclaration" expected after this input Position: C:\cygwin\home\Yoav\test\Hello.x10:13,16-14,17 Message: Syntax Error: Syntax error: Token(s) inserted to complete scope: "}" Position: C:\cygwin\home\Yoav\test\Hello.x10:16,1-2 Message: Syntax Error: Syntax error: Unexpected input ignored: "ERROR_TOKEN"
Activity
David Grove
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | X10 2.1.2 [ 16498 ] |
David Grove
made changes -
| Fix Version/s | X10 2.2 [ 16002 ] | |
| Fix Version/s | X10 2.1.2 [ 16498 ] |
Igor Peshansky
made changes -
| Fix Version/s | X10 2.2.1 [ 17131 ] | |
| Fix Version/s | X10 2.2 [ 16002 ] |
David Grove
made changes -
| Fix Version/s | X10 2.2.2 [ 17639 ] | |
| Fix Version/s | X10 2.2.1 [ 17131 ] |
David Grove
made changes -
| Fix Version/s | X10 2.2.3 [ 18146 ] | |
| Fix Version/s | X10 2.2.2 [ 17639 ] |
David Grove
made changes -
| Fix Version/s | X10 2.3 [ 17009 ] | |
| Fix Version/s | X10 2.2.3 [ 18146 ] |
David Grove
made changes -
| Fix Version/s | X10 2.3.1 [ 18657 ] | |
| Fix Version/s | X10 2.3 [ 17009 ] |
David Grove
made changes -
| Fix Version/s | X10 2.3.2 [ 19010 ] | |
| Fix Version/s | X10 2.3.1 [ 18657 ] |