Closed Bug 423706 Opened 18 years ago Closed 18 years ago

Parser generates ListExpr in many cases when it shouldn't

Categories

(Tamarin Graveyard :: Self-hosting compiler (ESC), defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lhansen, Assigned: lhansen)

Details

Attachments

(1 file)

This returns false as it should: delete Boolean.prototype This returns true: delete (Boolean.prototype)
This is an instance of a general parser bug wherein the parser returns Ast::ListExpr nodes far too often. The grammar production in question is ListExpression, but this production is overloaded to be used both on function parameters and on comma expressions. The latter cases should (probably) be rewritten to use a CommaExpression production which produces a simple expression if there's only one and Ast::Comma(x,y) otherwise. Note, this may cause some wrinkles in cogen which depends on Ast::ListExpr in a couple of places.
Also a problem for "typeof (x)" for the same reason.
Summary: delete operator is wonky → Parser generates ListExpr in many cases when it shouldn't
Attached patch Patch — — Splinter Review
Removes ListExpr from ESC, substitutes CommaExpr and cleans up some hacks that were necessary to support ListExpr previously.
Attachment #311190 - Flags: review?(jodyer)
Comment on attachment 311190 [details] [diff] [review] Patch This matches my updated grammar with one difference being is renamed parenListExpression to parenExpression rather than parenCommaExpression
Attachment #311190 - Flags: review?(jodyer) → review+
Changeset 485:ca35d6ab0083
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Was never pushed, new changeset 492:9068d6de7549
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: