fixes #5617, 'copyLineInfo' addition (#8523)

This commit is contained in:
andri lim 2018-08-06 04:38:21 +07:00 • committed by Andreas Rumpf
commit 6e3d1dced5
6 changed files with 40 additions and 23 deletions

View file

@ -1181,14 +1181,14 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
of mSameNodeType: genBinaryABC(c, n, dest, opcSameNodeType)
of mNLineInfo:
case n[0].sym.name.s
of "getFile":
genUnaryABC(c, n, dest, opcNGetFile)
of "getLine":
genUnaryABC(c, n, dest, opcNGetLine)
of "getColumn":
genUnaryABC(c, n, dest, opcNGetColumn)
else:
internalAssert c.config, false
of "getFile": genUnaryABI(c, n, dest, opcNGetLineInfo, 0)
of "getLine": genUnaryABI(c, n, dest, opcNGetLineInfo, 1)
of "getColumn": genUnaryABI(c, n, dest, opcNGetLineInfo, 2)
of "copyLineInfo":
internalAssert c.config, n.len == 3
unused(c, n, dest)
genBinaryStmt(c, n, opcNSetLineInfo)
else: internalAssert c.config, false
of mNHint:
unused(c, n, dest)
genUnaryStmt(c, n, opcNHint)