grammar update

Jeff Dyer jodyer at adobe.com
Tue Apr 1 21:30:56 PDT 2008


It should be

  var a = (function () type function ()) like AAA

In other words, your first option

  var a = FunctionExpression like AAA

where AAA must be a TypeExpression.

Jd


On 4/1/08 8:37 PM, Eric Suen wrote:

> Hi,
> 
> the statement is:
> 
> var a = function() type function() like AAA
> 
> RelationalExpression ::= RelationalExpression like TypeExpression
> 
> RelationalExpression -> PostfixExpression -> PrimaryExpression
>  -> FunctionExpression
> 
> FunctionExpression ::= function FunctionSignature FunctionExpressionBody
> 
> FunctionExpressionBody ::= AssignmentExpression
> 
> AssignmentExpression -> ConditionalExpression -> UnaryTypeExpression
> -> type TypeExpression -> type FunctionType
>  -> type function FunctionSignature
> 
> FunctionSignature ::= TypeParameters '(' Parameters ')' ResultType
> 
> ResultType ::= $empty
>  | ':' 'void'
>  | ':' TypeExpression
>  | 'like' TypeExpression  -- conflict on this rule with $empty
> 
> So, is it
>  var a = FunctionExpression like AAA
> or
>  var a = function() type FunctionType
> 
> 
> ----- Original Message -----
> From: "Eric Suen" <eric.suen.tech-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
> Newsgroups: gmane.comp.lang.javascript.ecmascript4.general
> To: <es4-discuss-4eJtQOnFJqFAfugRpC6u6w at public.gmane.org>
> Sent: Tuesday, April 01, 2008 7:35 PM
> Subject: Re: grammar update
> 
> 
>> Page 11
>> FunctionDeclaration ::= function FunctionName FunctionSignature
>> should be
>> FunctionDeclarationW ::= function FunctionName FunctionSignature SemicolonW
>> 
>> following statement:
>>  type function() like AAA
>> 
>> Should it be:
>> RelationalExpression like TypeExpression (like is operator)
>> [type function()] like [AAA]
>> or
>> type FunctionType (like is ResultType)
>> type [function() like AAA]
>> 
>> Regards,
>> 
>> Eric Suen 
> 
> 
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss




More information about the Es4-discuss mailing list