diff options
-rw-r--r-- | compiler/main.nim | 20 | ||||
-rw-r--r-- | compiler/renderer.nim | 9 | ||||
-rw-r--r-- | compiler/semexprs.nim | 3 | ||||
-rw-r--r-- | lib/pure/net.nim | 2 |
4 files changed, 7 insertions, 27 deletions
diff --git a/compiler/main.nim b/compiler/main.nim index 82e55058c..6afd9a73e 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) diff --git a/lib/pure/net.nim b/lib/pure/net.nim index e6fe79740..9a0bb6931 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -119,7 +119,7 @@ proc newSocket*(domain, typ, protocol: cint, buffered = true): Socket = result = newSocket(fd, buffered) proc newSocket*(domain: Domain = AF_INET, typ: SockType = SOCK_STREAM, - protocol: Protocol = IPPROTO_TCP, buffered = true): Socket = + protocol: Protocol = IPPROTO_TCP, buffered = true): Socket = ## Creates a new socket. ## ## If an error occurs EOS will be raised. |