`do' keyword in the grammar for lambda blocks
This commit is contained in:
parent
74498d616e
commit
560a3bad28
14 changed files with 83 additions and 36 deletions
|
|
@ -8,11 +8,12 @@
|
|||
#
|
||||
|
||||
# This include file implements lambda lifting for the transformator.
|
||||
# included from transf.nim
|
||||
|
||||
const
|
||||
declarativeDefs = {nkProcDef, nkMethodDef, nkIteratorDef,
|
||||
nkConverterDef}
|
||||
procDefs = {nkLambda} + declarativeDefs
|
||||
procDefs = nkLambdaKinds + declarativeDefs
|
||||
|
||||
proc indirectAccess(a, b: PSym, info: TLineInfo): PNode =
|
||||
# returns a[].b as a node
|
||||
|
|
@ -169,7 +170,7 @@ proc createEnvStmt(c: PTransf, varList: TCapture, env: PSym): PTransNode =
|
|||
IdNodeTablePut(c.transCon.mapping, v, fieldAccess)
|
||||
|
||||
proc transformProcFin(c: PTransf, n: PNode, s: PSym): PTransNode =
|
||||
if n.kind == nkLambda:
|
||||
if n.kind in nkLambdaKinds:
|
||||
# for lambdas we transformed 'n.sons[bodyPos]', but not 'ast.n[bodyPos]'!
|
||||
s.ast.sons[bodyPos] = n.sons[bodyPos]
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue