Parse function definitions more strictly

This commit is contained in:
Max Brunsfeld 2018-02-27 10:54:20 -08:00
parent 8ca2ecd52d
commit 7e73a575e9
1 changed files with 4 additions and 3 deletions

View File

@ -123,9 +123,10 @@ module.exports = grammar({
),
function_definition: $ => seq(
optional('function'),
$.word,
optional(seq('(', ')')),
choice(
seq('function', $.word, optional(seq('(', ')'))),
seq($.word, '(', ')')
),
$.compound_statement,
optional($.file_redirect)
),