fixes #593
This commit is contained in:
parent
8b5aa221ad
commit
e3ecc328a1
2 changed files with 4 additions and 5 deletions
|
|
@ -38,12 +38,11 @@ proc getModuleName*(n: PNode): string =
|
||||||
# hacky way to implement 'x / y /../ z':
|
# hacky way to implement 'x / y /../ z':
|
||||||
result = renderTree(n, {renderNoComments}).replace(" ")
|
result = renderTree(n, {renderNoComments}).replace(" ")
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
result = renderTree(n, {renderNoComments}).replace(".")
|
result = renderTree(n, {renderNoComments}).replace(".", "/")
|
||||||
of nkImportAs:
|
of nkImportAs:
|
||||||
result = getModuleName(n.sons[0])
|
result = getModuleName(n.sons[0])
|
||||||
else:
|
else:
|
||||||
localError(n.info, errGenerated,
|
localError(n.info, errGenerated, "invalid module name: '$1'" % n.renderTree)
|
||||||
"invalid module name: '$1'" % renderTree(n))
|
|
||||||
result = ""
|
result = ""
|
||||||
|
|
||||||
proc checkModuleName*(n: PNode): int32 =
|
proc checkModuleName*(n: PNode): int32 =
|
||||||
|
|
|
||||||
|
|
@ -984,7 +984,7 @@ proc genSym(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
of skProc, skConverter, skMethod:
|
of skProc, skConverter, skMethod:
|
||||||
discard mangleName(s)
|
discard mangleName(s)
|
||||||
r.res = s.loc.r
|
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 != {}:
|
{sfImportc, sfInfixCall} * s.flags != {}:
|
||||||
nil
|
nil
|
||||||
elif s.kind == skMethod and s.getBody.kind == nkEmpty:
|
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
|
let s = n.sons[namePos].sym
|
||||||
discard mangleName(s)
|
discard mangleName(s)
|
||||||
r.res = s.loc.r
|
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):
|
elif not p.g.generatedSyms.containsOrIncl(s.id):
|
||||||
app(p.locals, genProc(p, s))
|
app(p.locals, genProc(p, s))
|
||||||
of nkMetaNode: gen(p, n.sons[0], r)
|
of nkMetaNode: gen(p, n.sons[0], r)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue