From d4e5d26413809adfdb251f378d0c0daa79b1c9c2 Mon Sep 17 00:00:00 2001 From: 11poe <404johnnydoe@gmail.com> Date: Thu, 31 Oct 2024 00:00:23 +0100 Subject: [PATCH 1/2] Remove namelist, fix parlist --- _pages/grammar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_pages/grammar.md b/_pages/grammar.md index 37bb1ba..b3f6876 100644 --- a/_pages/grammar.md +++ b/_pages/grammar.md @@ -28,10 +28,10 @@ laststat = 'return' [explist] | 'break' | 'continue' funcname = NAME {'.' NAME} [':' NAME] funcbody = ['<' GenericTypeList '>'] '(' [parlist] ')' [':' ReturnType] block 'end' -parlist = bindinglist [',' '...' [':' GenericTypePack | Type]] + +parlist = bindinglist [',' '...' [':' (GenericTypePack | Type)]] | '...' [':' (GenericTypePack | Type)] explist = {exp ','} exp -namelist = NAME {',' NAME} binding = NAME [':' Type] bindinglist = binding [',' bindinglist] (* equivalent of Lua 5.1 'namelist', except with optional type annotations *) From 92e7fe4439809c8781600f4370c22ae090088719 Mon Sep 17 00:00:00 2001 From: 11poe <404johnnydoe@gmail.com> Date: Thu, 31 Oct 2024 00:01:06 +0100 Subject: [PATCH 2/2] Remove whitespace --- _pages/grammar.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_pages/grammar.md b/_pages/grammar.md index b3f6876..b602dfd 100644 --- a/_pages/grammar.md +++ b/_pages/grammar.md @@ -28,7 +28,6 @@ laststat = 'return' [explist] | 'break' | 'continue' funcname = NAME {'.' NAME} [':' NAME] funcbody = ['<' GenericTypeList '>'] '(' [parlist] ')' [':' ReturnType] block 'end' - parlist = bindinglist [',' '...' [':' (GenericTypePack | Type)]] | '...' [':' (GenericTypePack | Type)] explist = {exp ','} exp