From 1da8e603237144f44710360f8feb7a9977e905e0 Mon Sep 17 00:00:00 2001 From: "Robert J. Simmons" Date: Thu, 5 Oct 2017 17:36:50 -0400 Subject: [PATCH] Make Directive | Statement comments meaningful (#173) * Make Directive | Statement comments meaningful Because a Directive is an ExpressionStatement and an ExpressionStatement is a Statement, the use of Directive | Statement option was redundant. This change attempts to capture the intent of the Directive | Statement, by making it clear that while Directive is structurally a subtype of ExpressionStatement, the directive type is not a valid addition to any ExpressionStatement, just ones that are children of a Function or Program. * Make Directive hold only Literal expressions. At the suggestion of @RReverser, express the further refinement that the subexpression of a Directive is always a Literal. --- es5.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es5.md b/es5.md index 90a5191..60dad83 100644 --- a/es5.md +++ b/es5.md @@ -177,7 +177,9 @@ An expression statement, i.e., a statement consisting of a single expression. ## Directive ```js -interface Directive <: ExpressionStatement { +interface Directive <: Node { + type: "ExpressionStatement"; + expression: Literal; directive: string; } ```