fix 32 bit problem
This commit is contained in:
parent
f6a7da52e0
commit
a0607c6375
|
@ -276,7 +276,7 @@ proc scanNumber(lexer: var JsonLexer) =
|
|||
lexer.tok = tkInt
|
||||
let scannedValue = lexer.scanInt()
|
||||
checkForNonPortableInt scannedValue
|
||||
lexer.intVal = int(scannedValue)
|
||||
lexer.intVal = int64(scannedValue)
|
||||
if lexer.stream[].eof: return
|
||||
c = lexer.stream[].peek()
|
||||
if c == '.':
|
||||
|
|
|
@ -40,6 +40,10 @@ suite "lexer tests":
|
|||
expectedToken tkInt, lexer.intVal == 190
|
||||
expectedToken tkEof
|
||||
|
||||
lexerTest "int64 literal", "3568257348920230622":
|
||||
expectedToken tkInt, lexer.intVal == 3568257348920230622'i64
|
||||
expectedToken tkEof
|
||||
|
||||
lexerTest "float literal", ".340":
|
||||
expectedToken tkFloat, lexer.floatVal =~ 0.340
|
||||
expectedToken tkEof
|
||||
|
|
|
@ -3,7 +3,7 @@ import
|
|||
|
||||
proc dedent*(s: string): string =
|
||||
var s = s.strip(leading = false)
|
||||
var minIndent = 99999999999
|
||||
var minIndent = high(int)
|
||||
for l in s.splitLines:
|
||||
let indent = count(l, ' ')
|
||||
if indent == 0: continue
|
||||
|
|
Loading…
Reference in New Issue