diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main.nim | 20 | ||||
-rw-r--r-- | compiler/renderer.nim | 9 | ||||
-rw-r--r-- | compiler/semexprs.nim | 3 |
3 files changed, 6 insertions, 26 deletions
diff --git a/compiler/main.nim b/compiler/main.nim index 0eaf506f5..05209fa80 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -19,12 +19,6 @@ import from magicsys import systemModule, resetSysTypes -const - hasLLVM_Backend = false - -when hasLLVM_Backend: - import llvmgen - proc rodPass = if optSymbolFiles in gGlobalOptions: registerPass(rodwritePass) @@ -111,14 +105,6 @@ proc commandCompileToC = ccgutils.resetCaches() GC_fullCollect() -when hasLLVM_Backend: - proc commandCompileToLLVM = - semanticPasses() - registerPass(llvmgen.llvmgenPass()) - rodPass() - #registerPass(cleanupPass()) - compileProject() - proc commandCompileToJS = #incl(gGlobalOptions, optSafeCode) setTarget(osJS, cpuJS) @@ -290,12 +276,6 @@ proc mainCommand* = of "js", "compiletojs": gCmd = cmdCompileToJS commandCompileToJS() - of "compiletollvm": - gCmd = cmdCompileToLLVM - when hasLLVM_Backend: - CommandCompileToLLVM() - else: - rawMessage(errInvalidCommandX, command) of "doc": wantMainModule() gCmd = cmdDoc diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 2bbe8ac80..204bfbf94 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -46,12 +46,13 @@ proc getNextTok*(r: var TSrcGen, kind: var TTokType, literal: var string) # determines how long the subtree will likely be, the second # phase appends to a buffer that will be the output. -proc isKeyword*(s: string): bool = - var i = getIdent(s) +proc isKeyword*(i: PIdent): bool = if (i.id >= ord(tokKeywordLow) - ord(tkSymbol)) and - (i.id <= ord(tokKeywordHigh) - ord(tkSymbol)): + (i.id <= ord(tokKeywordHigh) - ord(tkSymbol)): result = true +proc isKeyword*(s: string): bool = isKeyword(getIdent(s)) + proc renderDefinitionName*(s: PSym, noQuotes = false): string = ## Returns the definition name of the symbol. ## @@ -59,7 +60,7 @@ proc renderDefinitionName*(s: PSym, noQuotes = false): string = ## happen if the name happens to be a keyword or the first character is not ## part of the SymStartChars set. let x = s.name.s - if noQuotes or (x[0] in SymStartChars and not renderer.isKeyword(x)): + if noQuotes or (x[0] in SymStartChars and not renderer.isKeyword(s.name)): result = x else: result = '`' & x & '`' diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 68921a15a..5e61c4a0b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -964,7 +964,6 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = var ty = n.sons[0].typ var f: PSym = nil result = nil - if isTypeExpr(n.sons[0]) or (ty.kind == tyTypeDesc and ty.base.kind != tyNone): if ty.kind == tyTypeDesc: ty = ty.base ty = ty.skipTypes(tyDotOpTransparent) @@ -1053,7 +1052,7 @@ proc dotTransformation(c: PContext, n: PNode): PNode = proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode = # this is difficult, because the '.' is used in many different contexts - # in Nimrod. We first allow types in the semantic checking. + # in Nim. We first allow types in the semantic checking. result = builtinFieldAccess(c, n, flags) if result == nil: result = dotTransformation(c, n) |