Closed aMOPel closed 2 years ago
routineExpr = ('proc' | 'func' | 'iterator') paramListColon pragma? ('=' COMMENT? stmt)? primary = operatorB primary primarySuffix* | tupleDecl | routineExpr | enumDecl objectDecl | conceptDecl | ('bind' primary) ('var' | 'out' | 'ref' | 'ptr' | 'distinct') primary / prefixOperator* identOrLiteral primarySuffix*`'|IDENT|literal|'cast'|'addr'|'type') expr # <==== HERE command syntax
let p = proc (a: int): int = a * 2
https://nim-lang.org/docs/manual.html#procedures-anonymous-procs also test for the sugar: https://nim-lang.org/docs/sugar.html#%3D%3E.m%2Cuntyped%2Cuntyped
official grammar:
example:
https://nim-lang.org/docs/manual.html#procedures-anonymous-procs also test for the sugar: https://nim-lang.org/docs/sugar.html#%3D%3E.m%2Cuntyped%2Cuntyped