diff --git a/compiler/importer.nim b/compiler/importer.nim index 077e5e0c96..54ffb19475 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -38,12 +38,11 @@ proc getModuleName*(n: PNode): string = # hacky way to implement 'x / y /../ z': result = renderTree(n, {renderNoComments}).replace(" ") of nkDotExpr: - result = renderTree(n, {renderNoComments}).replace(".") + result = renderTree(n, {renderNoComments}).replace(".", "/") of nkImportAs: result = getModuleName(n.sons[0]) else: - localError(n.info, errGenerated, - "invalid module name: '$1'" % renderTree(n)) + localError(n.info, errGenerated, "invalid module name: '$1'" % n.renderTree) result = "" proc checkModuleName*(n: PNode): int32 = diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index fc186c379c..8f5ef4bce5 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -984,7 +984,7 @@ proc genSym(p: PProc, n: PNode, r: var TCompRes) = of skProc, skConverter, skMethod: discard mangleName(s) r.res = s.loc.r - if lfNoDecl in s.loc.flags or s.magic != mNone or isGenericRoutine(s) or + if lfNoDecl in s.loc.flags or s.magic != mNone or {sfImportc, sfInfixCall} * s.flags != {}: nil elif s.kind == skMethod and s.getBody.kind == nkEmpty: @@ -1583,7 +1583,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) = let s = n.sons[namePos].sym discard mangleName(s) r.res = s.loc.r - if lfNoDecl in s.loc.flags or s.magic != mNone or isGenericRoutine(s): nil + if lfNoDecl in s.loc.flags or s.magic != mNone: nil elif not p.g.generatedSyms.containsOrIncl(s.id): app(p.locals, genProc(p, s)) of nkMetaNode: gen(p, n.sons[0], r)