PR# 17582 Pretty printer accepts invalid attribute declarations
Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Medium
Date: 2011/05/30
Class: Bug
Severity: Non-critical
Number: 17582
Release: 6.8.86542
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.8) Gecko/20100226 Firefox/3.5.8
Synopsis: Pretty printer accepts invalid attribute declarations
Description
Perhaps this is not the responsibility of the pretty printer, but I noticed a case that I found a bit surprising. Invalid attribute declarations such as value attribute end are reported as syntax errors by the compiler, but the pretty printer accepts them. I assumed that the pretty printer would produce a pretty version of a class if and only if the class did not have a syntax error, but that doesn't hold for this case. I realize that "attribute" was not always a keyword, but if it is treated as an identifier the class is still not syntactically correct. If you think the current behavior of the pretty printer is correct, you can close this bug.
To Reproduce
Run ec -pretty on attached class. Prettifies the class even though it has syntax errors.