fixes #572
This commit is contained in:
parent
7056ceda67
commit
a17076cf4f
2 changed files with 8 additions and 5 deletions
|
|
@ -408,12 +408,12 @@ proc GetNumber(L: var TLexer): TToken =
|
||||||
(result.tokType == tkFloat64Lit):
|
(result.tokType == tkFloat64Lit):
|
||||||
result.fnumber = parseFloat(result.literal)
|
result.fnumber = parseFloat(result.literal)
|
||||||
if result.tokType == tkIntLit: result.tokType = tkFloatLit
|
if result.tokType == tkIntLit: result.tokType = tkFloatLit
|
||||||
else:
|
else:
|
||||||
result.iNumber = ParseBiggestInt(result.literal)
|
result.iNumber = parseBiggestInt(result.literal)
|
||||||
if (result.iNumber < low(int32)) or (result.iNumber > high(int32)):
|
if (result.iNumber < low(int32)) or (result.iNumber > high(int32)):
|
||||||
if result.tokType == tkIntLit:
|
if result.tokType == tkIntLit:
|
||||||
result.tokType = tkInt64Lit
|
result.tokType = tkInt64Lit
|
||||||
elif result.tokType != tkInt64Lit:
|
elif result.tokType in {tkInt8Lit, tkInt16Lit}:
|
||||||
lexMessage(L, errInvalidNumber, result.literal)
|
lexMessage(L, errInvalidNumber, result.literal)
|
||||||
except EInvalidValue:
|
except EInvalidValue:
|
||||||
lexMessage(L, errInvalidNumber, result.literal)
|
lexMessage(L, errInvalidNumber, result.literal)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
# Test various aspects
|
# Test various aspects
|
||||||
|
|
||||||
|
# bug #572
|
||||||
|
var a=12345678901'u64
|
||||||
|
|
||||||
var x = (x: 42, y: (a: 8, z: 10))
|
var x = (x: 42, y: (a: 8, z: 10))
|
||||||
echo x.y
|
echo x.y
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue