bugfix: package names should not contain '.'
This commit is contained in:
parent
90d25919f3
commit
9bf32ff72d
2 changed files with 17 additions and 5 deletions
|
|
@ -219,8 +219,10 @@ proc getPackageName*(path: string): string =
|
||||||
else:
|
else:
|
||||||
let x = path.substr(i+1, b-1)
|
let x = path.substr(i+1, b-1)
|
||||||
case x.normalize
|
case x.normalize
|
||||||
of "lib", "src", "source", "package", "pckg", "library": b = i
|
of "lib", "src", "source", "package", "pckg", "library", "private":
|
||||||
else: return x
|
b = i
|
||||||
|
else:
|
||||||
|
return x.replace('.', '_')
|
||||||
result = ""
|
result = ""
|
||||||
|
|
||||||
proc withPackageName*(path: string): string =
|
proc withPackageName*(path: string): string =
|
||||||
|
|
|
||||||
|
|
@ -231,11 +231,11 @@ proc compile(c: PCtx, s: PSym): int =
|
||||||
result = vmgen.genProc(c, s)
|
result = vmgen.genProc(c, s)
|
||||||
#c.echoCode
|
#c.echoCode
|
||||||
|
|
||||||
proc execute(c: PCtx, start: int) =
|
proc rawExecute(c: PCtx, start: int, tos: PStackFrame) =
|
||||||
var pc = start
|
var pc = start
|
||||||
|
var tos = tos
|
||||||
var regs: TNodeSeq # alias to tos.slots for performance
|
var regs: TNodeSeq # alias to tos.slots for performance
|
||||||
var tos: PStackFrame
|
move(regs, tos.slots)
|
||||||
newSeq(regs, c.prc.maxSlots)
|
|
||||||
while true:
|
while true:
|
||||||
{.computedGoto.}
|
{.computedGoto.}
|
||||||
let instr = c.code[pc]
|
let instr = c.code[pc]
|
||||||
|
|
@ -841,6 +841,13 @@ proc execute(c: PCtx, start: int) =
|
||||||
regs[ra].strVal = typ.typeToString(preferExported)
|
regs[ra].strVal = typ.typeToString(preferExported)
|
||||||
inc pc
|
inc pc
|
||||||
|
|
||||||
|
proc execute(c: PCtx, start: int) =
|
||||||
|
var pc = start
|
||||||
|
var regs: TNodeSeq # alias to tos.slots for performance
|
||||||
|
var tos: PStackFrame
|
||||||
|
newSeq(tos.slots, c.prc.maxSlots)
|
||||||
|
rawExecute(c, start, tos)
|
||||||
|
|
||||||
proc evalStmt*(c: PCtx, n: PNode) =
|
proc evalStmt*(c: PCtx, n: PNode) =
|
||||||
let start = genStmt(c, n)
|
let start = genStmt(c, n)
|
||||||
# execute new instructions; this redundant opcEof check saves us lots
|
# execute new instructions; this redundant opcEof check saves us lots
|
||||||
|
|
@ -892,6 +899,9 @@ proc setupMacroParam(x: PNode): PNode =
|
||||||
result = x
|
result = x
|
||||||
if result.kind in {nkHiddenSubConv, nkHiddenStdConv}: result = result.sons[1]
|
if result.kind in {nkHiddenSubConv, nkHiddenStdConv}: result = result.sons[1]
|
||||||
|
|
||||||
|
type
|
||||||
|
PEvalContext* = PCtx
|
||||||
|
|
||||||
proc evalMacroCall(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode =
|
proc evalMacroCall(c: PEvalContext, n, nOrig: PNode, sym: PSym): PNode =
|
||||||
# XXX GlobalError() is ugly here, but I don't know a better solution for now
|
# XXX GlobalError() is ugly here, but I don't know a better solution for now
|
||||||
inc(evalTemplateCounter)
|
inc(evalTemplateCounter)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue