fixes #3545
This commit is contained in:
parent
db56174a19
commit
ab3c684c62
1 changed files with 7 additions and 6 deletions
|
|
@ -286,13 +286,14 @@ proc evalOp(m: TMagic, n, a, b, c: PNode): PNode =
|
||||||
of mNot: result = newIntNodeT(1 - getInt(a), n)
|
of mNot: result = newIntNodeT(1 - getInt(a), n)
|
||||||
of mCard: result = newIntNodeT(nimsets.cardSet(a), n)
|
of mCard: result = newIntNodeT(nimsets.cardSet(a), n)
|
||||||
of mBitnotI: result = newIntNodeT(not getInt(a), n)
|
of mBitnotI: result = newIntNodeT(not getInt(a), n)
|
||||||
of mLengthStr, mXLenStr:
|
|
||||||
if a.kind == nkNilLit: result = newIntNodeT(0, n)
|
|
||||||
else: result = newIntNodeT(len(getStr(a)), n)
|
|
||||||
of mLengthArray: result = newIntNodeT(lengthOrd(a.typ), n)
|
of mLengthArray: result = newIntNodeT(lengthOrd(a.typ), n)
|
||||||
of mLengthSeq, mLengthOpenArray, mXLenSeq:
|
of mLengthSeq, mLengthOpenArray, mXLenSeq, mLengthStr, mXLenStr:
|
||||||
if a.kind == nkNilLit: result = newIntNodeT(0, n)
|
if a.kind == nkNilLit:
|
||||||
else: result = newIntNodeT(sonsLen(a), n) # BUGFIX
|
result = newIntNodeT(0, n)
|
||||||
|
elif a.kind in {nkStrLit..nkTripleStrLit}:
|
||||||
|
result = newIntNodeT(len a.strVal, n)
|
||||||
|
else:
|
||||||
|
result = newIntNodeT(sonsLen(a), n) # BUGFIX
|
||||||
of mUnaryPlusI, mUnaryPlusF64: result = a # throw `+` away
|
of mUnaryPlusI, mUnaryPlusF64: result = a # throw `+` away
|
||||||
of mToFloat, mToBiggestFloat:
|
of mToFloat, mToBiggestFloat:
|
||||||
result = newFloatNodeT(toFloat(int(getInt(a))), n)
|
result = newFloatNodeT(toFloat(int(getInt(a))), n)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue