Optional initialiser in field declaration, to match examples (!)
This commit is contained in:
parent
add689623e
commit
183f104ade
|
@ -129,9 +129,11 @@ var modifiedSourceActions = {
|
||||||
label + ', ' + JSON.stringify(formals) + ');';
|
label + ', ' + JSON.stringify(formals) + ');';
|
||||||
},
|
},
|
||||||
|
|
||||||
FieldDeclarationStatement: function(_field, memberExpr, _eq, initExpr, sc) {
|
FieldDeclarationStatement: function(_field, memberExpr, _eq, maybeInitExpr, sc) {
|
||||||
return 'Syndicate.Actor.declareField(' + memberExpr.memberObjectExpr.asES5 + ', ' +
|
return 'Syndicate.Actor.declareField(' + memberExpr.memberObjectExpr.asES5 + ', ' +
|
||||||
memberExpr.memberPropExpr.asES5 + ', ' + initExpr.asES5 + ')' +
|
memberExpr.memberPropExpr.asES5 + ', ' +
|
||||||
|
(maybeInitExpr.numChildren === 1 ? maybeInitExpr.asES5 : 'undefined') +
|
||||||
|
')' +
|
||||||
sc.interval.contents;
|
sc.interval.contents;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ Syndicate <: ES5 {
|
||||||
AssertionTypeDeclarationStatement
|
AssertionTypeDeclarationStatement
|
||||||
= (assertion | message) type identifier "(" FormalParameterList ")" ("=" stringLiteral)? #(sc)
|
= (assertion | message) type identifier "(" FormalParameterList ")" ("=" stringLiteral)? #(sc)
|
||||||
|
|
||||||
FieldDeclarationStatement = field MemberExpression "=" AssignmentExpression<withIn> #(sc)
|
FieldDeclarationStatement = field MemberExpression ("=" AssignmentExpression<withIn>)? #(sc)
|
||||||
MemberExpression += field MemberExpression -- fieldRefExp
|
MemberExpression += field MemberExpression -- fieldRefExp
|
||||||
UnaryExpression += delete field MemberExpression -- fieldDelExp
|
UnaryExpression += delete field MemberExpression -- fieldDelExp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue