From 7e73a575e92e1ef574fc8a5ea057e12668ecc6dd Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 27 Feb 2018 10:54:20 -0800 Subject: [PATCH] Parse function definitions more strictly --- grammar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grammar.js b/grammar.js index c6b132c..04df5a6 100644 --- a/grammar.js +++ b/grammar.js @@ -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) ),