Merge pull request #7770 from yglukhov/yield-in-try

Yield in try
This commit is contained in:
Andreas Rumpf 2018-06-05 19:58:00 +02:00 • committed by GitHub
commit 3cbc07ac78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1790 additions and 77 deletions

View file

@ -1413,11 +1413,21 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
put(g, tkParLe, "(ComesFrom|")
gsub(g, n, 0)
put(g, tkParRi, ")")
of nkGotoState, nkState:
of nkGotoState:
var c: TContext
initContext c
putWithSpace g, tkSymbol, if n.kind == nkState: "state" else: "goto"
putWithSpace g, tkSymbol, "goto"
gsons(g, n, c)
of nkState:
var c: TContext
initContext c
putWithSpace g, tkSymbol, "state"
gsub(g, n[0], c)
putWithSpace(g, tkColon, ":")
indentNL(g)
gsons(g, n, c, 1)
dedent(g)
of nkBreakState:
put(g, tkTuple, "breakstate")
of nkTypeClassTy: