js codegen: emit more line information
This commit is contained in:
parent
4cce5883c0
commit
3d34a9f6d3
1 changed files with 14 additions and 12 deletions
|
|
@ -434,22 +434,23 @@ proc binaryExpr(p: PProc, n: PNode, r: var TCompRes, magic, frmt: string) =
|
||||||
|
|
||||||
proc unsignedTrimmerJS(size: BiggestInt): Rope =
|
proc unsignedTrimmerJS(size: BiggestInt): Rope =
|
||||||
case size
|
case size
|
||||||
of 1: rope"& 0xff"
|
of 1: rope"& 0xff"
|
||||||
of 2: rope"& 0xffff"
|
of 2: rope"& 0xffff"
|
||||||
of 4: rope">>> 0"
|
of 4: rope">>> 0"
|
||||||
else: rope""
|
else: rope""
|
||||||
|
|
||||||
proc unsignedTrimmerPHP(size: BiggestInt): Rope =
|
proc unsignedTrimmerPHP(size: BiggestInt): Rope =
|
||||||
case size
|
case size
|
||||||
of 1: rope"& 0xff"
|
of 1: rope"& 0xff"
|
||||||
of 2: rope"& 0xffff"
|
of 2: rope"& 0xffff"
|
||||||
of 4: rope"& 0xffffffff"
|
of 4: rope"& 0xffffffff"
|
||||||
else: rope""
|
else: rope""
|
||||||
|
|
||||||
template unsignedTrimmer(size: BiggestInt): Rope =
|
template unsignedTrimmer(size: BiggestInt): Rope =
|
||||||
size.unsignedTrimmerJS | size.unsignedTrimmerPHP
|
size.unsignedTrimmerJS | size.unsignedTrimmerPHP
|
||||||
|
|
||||||
proc binaryUintExpr(p: PProc, n: PNode, r: var TCompRes, op: string, reassign: bool = false) =
|
proc binaryUintExpr(p: PProc, n: PNode, r: var TCompRes, op: string,
|
||||||
|
reassign = false) =
|
||||||
var x, y: TCompRes
|
var x, y: TCompRes
|
||||||
gen(p, n.sons[1], x)
|
gen(p, n.sons[1], x)
|
||||||
gen(p, n.sons[2], y)
|
gen(p, n.sons[2], y)
|
||||||
|
|
@ -2128,6 +2129,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
else: r.res = rope(f.toStrMaxPrecision)
|
else: r.res = rope(f.toStrMaxPrecision)
|
||||||
r.kind = resExpr
|
r.kind = resExpr
|
||||||
of nkCallKinds:
|
of nkCallKinds:
|
||||||
|
if isEmptyType(n.typ): genLineDir(p, n)
|
||||||
if (n.sons[0].kind == nkSym) and (n.sons[0].sym.magic != mNone):
|
if (n.sons[0].kind == nkSym) and (n.sons[0].sym.magic != mNone):
|
||||||
genMagic(p, n, r)
|
genMagic(p, n, r)
|
||||||
elif n.sons[0].kind == nkSym and sfInfixCall in n.sons[0].sym.flags and
|
elif n.sons[0].kind == nkSym and sfInfixCall in n.sons[0].sym.flags and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue