Now using simple counter for compiled variables.
h3rald h3rald@h3rald.com
Wed, 16 Dec 2020 03:39:43 +0100
1 files changed,
8 insertions(+),
4 deletions(-)
jump to
M
core/parser.nim
→
core/parser.nim
@@ -3,7 +3,6 @@ import
lexbase, strutils, sequtils, - oids, streams, critbits, baseutils@@ -119,6 +118,8 @@ MinUndefinedError* = ref object of ValueError
MinEmptyStackError* = ref object of ValueError MinInvalidError* = ref object of ValueError MinOutOfBoundsError* = ref object of ValueError + +var CVARCOUNT = 0 # Helpers@@ -695,7 +696,8 @@ of tkFloat:
result = @[op&"MinValue(kind: minFloat, floatVal: "&p.a&")"] discard getToken(p) of tkBracketLe: - var qvar = "q" & $genOid() + CVARCOUNT.inc + var qvar = "q" & $CVARCOUNT result.add indent&"var "&qvar&" = newSeq[MinValue](0)" discard getToken(p) while p.token != tkBracketRi:@@ -711,8 +713,10 @@ var val: MinValue
discard getToken(p) var c = 0 var valInitialized = false - var scopevar = "scope" & $genOid() - var valvar = "val" & $genOid() + CVARCOUNT.inc + var scopevar = "scope" & $CVARCOUNT + CVARCOUNT.inc + var valvar = "val" & $CVARCOUNT while p.token != tkBraceRi: c = c+1 var instructions = p.compileMinValue(i, false, indent)