From 0c148f361388369249b13cf5618a27873ac46bfb Mon Sep 17 00:00:00 2001 From: vladmos Date: Thu, 5 Apr 2018 03:03:46 -0700 Subject: Fix the definition of Argument in the Skylark specification PiperOrigin-RevId: 191717115 --- site/docs/skylark/spec.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'site/docs/skylark/spec.md') diff --git a/site/docs/skylark/spec.md b/site/docs/skylark/spec.md index 5eedb45dfc..6cb428b1cf 100644 --- a/site/docs/skylark/spec.md +++ b/site/docs/skylark/spec.md @@ -1635,10 +1635,10 @@ print(x) # 1 ### Function and method calls ```text -CallSuffix = '(' [Arguments] ')' . +CallSuffix = '(' [Arguments [',']] ')' . Arguments = Argument {',' Argument} . -Argument = Test | identifier '=' Test | '*' identifier | '**' identifier . +Argument = Test | identifier '=' Test | '*' Test | '**' Test . ``` A value `f` of type `function` may be called using the expression `f(...)`. @@ -3161,6 +3161,7 @@ File = {Statement | newline} eof . Statement = DefStmt | IfStmt | ForStmt | SimpleStmt . DefStmt = 'def' identifier '(' [Parameters [',']] ')' ':' Suite . +# NOTE: trailing comma is not permitted if the last argument is `'*' identifier` or `'**' identifier`. Parameters = Parameter {',' Parameter}. @@ -3214,11 +3215,12 @@ Operand = identifier . DotSuffix = '.' identifier . -CallSuffix = '(' [Arguments [',']] ')' . SliceSuffix = '[' [Expression] [':' Test [':' Test]] ']' . +CallSuffix = '(' [Arguments [',']] ')' . +# NOTE: trailing comma is not permitted if the last argument is `'*' Test` or `'**' Test`. Arguments = Argument {',' Argument} . -Argument = Test | identifier '=' Test | '*' identifier | '**' identifier . +Argument = Test | identifier '=' Test | '*' Test | '**' Test . ListExpr = '[' [Expression [',']] ']' . ListComp = '[' Test {CompClause} ']'. -- cgit v1.2.3