diff options
author | vladmos <vladmos@google.com> | 2018-04-05 03:03:46 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-05 03:05:04 -0700 |
commit | 0c148f361388369249b13cf5618a27873ac46bfb (patch) | |
tree | 5361326e0c348ef409fea90a5c91373bdfb4dfb1 /site/docs/skylark | |
parent | 832a0b193a9a098897781bc6298d0455b3913482 (diff) |
Fix the definition of Argument in the Skylark specification
PiperOrigin-RevId: 191717115
Diffstat (limited to 'site/docs/skylark')
-rw-r--r-- | site/docs/skylark/spec.md | 10 |
1 files changed, 6 insertions, 4 deletions
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} ']'. |