treat do with pragmas but no parens as proc (#19191)

fixes #19188
This commit is contained in:
hlaaftana 2021-12-05 08:44:22 +03:00 • committed by GitHub
commit 1ef945668d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 9 deletions

View file

@ -3834,10 +3834,10 @@ The proc expression represented by the `do` block is appended to the routine
call as the last argument. In calls using the command syntax, the `do` block
will bind to the immediately preceding expression rather than the command call.
`do` with a parameter list corresponds to an anonymous `proc`, however
`do` without parameters is treated as a normal statement list. This allows
macros to receive both indented statement lists as an argument in inline
calls, as well as a direct mirror of Nim's routine syntax.
`do` with a parameter list or pragma list corresponds to an anonymous `proc`,
however `do` without parameters or pragmas is treated as a normal statement
list. This allows macros to receive both indented statement lists as an
argument in inline calls, as well as a direct mirror of Nim's routine syntax.
.. code-block:: nim
# Passing a statement list to an inline macro: