-
We have the following expression to detect "invalid" empty parens by having the validator mark the valid syntax as invalid:
I'm also trying to add arrow function syntax into the grammar, ArrowFunctionExpression:
Parameters (":" ReturnType)? "=>" body=(ArrowReturnExpression | Block); where For example, this is invalid code that the validator should flag, (); while this is valid code: const f = () => {} How can we achieve having both of those things in the language? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It seems like FunctionDeclaration:
- OriginalFunctionDeclaration | GeneratorFunctionDeclaration;
+ OriginalFunctionDeclaration | GeneratorFunctionDeclaration | ArrowFunctionExpression; That seems to work as expected: |
Beta Was this translation helpful? Give feedback.
It seems like
ArrowFunctionExpression
is currently unused, right? I've tried your currentmain
with a minor change:That seems to work as expected: