diff options
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/docgen.nim | 2 | ||||
-rwxr-xr-x | compiler/lexer.nim | 4 | ||||
-rwxr-xr-x | compiler/parser.nim | 5 | ||||
-rwxr-xr-x | compiler/renderer.nim | 2 | ||||
-rwxr-xr-x | compiler/semexprs.nim | 4 | ||||
-rwxr-xr-x | compiler/semthreads.nim | 8 | ||||
-rwxr-xr-x | compiler/wordrecg.nim | 6 |
7 files changed, 13 insertions, 18 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index cd7d459fd..fc019790a 100755 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -339,7 +339,7 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = of tokKeywordLow..tokKeywordHigh: dispA(result, "<span class=\"Keyword\">$1</span>", "\\spanKeyword{$1}", [toRope(literal)]) - of tkOpr, tkHat: + of tkOpr: dispA(result, "<span class=\"Operator\">$1</span>", "\\spanOperator{$1}", [toRope(esc(literal))]) of tkStrLit..tkTripleStrLit: diff --git a/compiler/lexer.nim b/compiler/lexer.nim index 2174a696f..7d6503929 100755 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -49,7 +49,7 @@ type tkCurlyDotLe, tkCurlyDotRi, # {. and .} tkParDotLe, tkParDotRi, # (. and .) tkComma, tkSemiColon, tkColon, tkColonColon, tkEquals, tkDot, tkDotDot, - tkHat, tkOpr, tkComment, tkAccent, tkInd, tkSad, + tkOpr, tkComment, tkAccent, tkInd, tkSad, tkDed, # pseudo token types used by the source renderers: tkSpaces, tkInfixOpr, tkPrefixOpr, tkPostfixOpr TTokTypes* = set[TTokType] @@ -74,7 +74,7 @@ const "tkTripleStrLit", "tkGStrLit", "tkGTripleStrLit", "tkCharLit", "(", ")", "[", "]", "{", "}", "[.", ".]", "{.", ".}", "(.", ".)", ",", ";", ":", "::", - "=", ".", "..", "^", "tkOpr", "tkComment", "`", "[new indentation]", + "=", ".", "..", "tkOpr", "tkComment", "`", "[new indentation]", "[same indentation]", "[dedentation]", "tkSpaces", "tkInfixOpr", "tkPrefixOpr", "tkPostfixOpr"] diff --git a/compiler/parser.nim b/compiler/parser.nim index 42dc0b64b..aca891863 100755 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -450,11 +450,6 @@ proc primary(p: var TParser): PNode = optInd(p, result) addSon(result, parseSymbol(p)) result = parseGStrLit(p, result) - of tkHat: - var a = result - result = newNodeP(nkDerefExpr, p) - addSon(result, a) - getTok(p) of tkBracketLe: result = indexExprList(p, result) else: break diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 8dc629eb4..3c2e76694 100755 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -819,7 +819,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = gsub(g, n.sons[1]) of nkDerefExpr: gsub(g, n.sons[0]) - putWithSpace(g, tkHat, "^") + putWithSpace(g, tkOpr, "^") # unfortunately this requires a space, because ^. would be only one operator of nkAccQuoted: put(g, tkAccent, "`") diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 8f84d665d..879a42d81 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -237,8 +237,8 @@ proc changeType(n: PNode, newType: PType) = of nkPar: if newType.kind != tyTuple: InternalError(n.info, "changeType: no tuple type for constructor") - if newType.n == nil: InternalError(n.info, "changeType: no tuple fields") - if (sonsLen(n) > 0) and (n.sons[0].kind == nkExprColonExpr): + if newType.n == nil: nil + elif (sonsLen(n) > 0) and (n.sons[0].kind == nkExprColonExpr): for i in countup(0, sonsLen(n) - 1): var m = n.sons[i].sons[0] if m.kind != nkSym: diff --git a/compiler/semthreads.nim b/compiler/semthreads.nim index 5e52aea72..7355c3bfc 100755 --- a/compiler/semthreads.nim +++ b/compiler/semthreads.nim @@ -286,9 +286,9 @@ proc analyseOp(c: PProcCtx, n: PNode): TThreadOwner = proc analyse(c: PProcCtx, n: PNode): TThreadOwner = case n.kind - of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, + of nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit, nkHiddenCallConv: - result = analyseOp(c, n) + result = analyseOp(c, n) of nkAsgn, nkFastAsgn: analyseAssign(c, n) result = toVoid @@ -299,9 +299,9 @@ proc analyse(c: PProcCtx, n: PNode): TThreadOwner = of nkDotExpr, nkBracketExpr, nkDerefExpr, nkHiddenDeref: # field access: # pointer deref or array access: - result = analyse(c, n.sons[0]) + result = analyse(c, n.sons[0]) of nkBind: result = analyse(c, n.sons[0]) - of nkPar, nkCurly, nkBracket: + of nkPar, nkCurly, nkBracket, nkRange: # container construction: result = toNil # nothing until later for i in 0..n.len-1: aggregateOwner(result, analyse(c, n[i])) diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim index b55f13ae9..47d0fa3fc 100755 --- a/compiler/wordrecg.nim +++ b/compiler/wordrecg.nim @@ -32,7 +32,7 @@ type wShl, wShr, wTemplate, wTry, wTuple, wType, wVar, wWhen, wWhile, wWith, wWithout, wXor, wYield, - wColon, wColonColon, wEquals, wDot, wDotDot, wHat, wStar, wMinus, + wColon, wColonColon, wEquals, wDot, wDotDot, wStar, wMinus, wMagic, wThread, wFinal, wProfiler, wObjChecks, wImportCompilerProc, wImportc, wExportc, wExtern, @@ -65,7 +65,7 @@ type const oprLow* = ord(wColon) - oprHigh* = ord(wHat) + oprHigh* = ord(wDotDot) specialWords*: array[low(TSpecialWord)..high(TSpecialWord), string] = ["", "addr", "and", "as", "asm", "atomic", @@ -79,7 +79,7 @@ const "try", "tuple", "type", "var", "when", "while", "with", "without", "xor", "yield", - ":", "::", "=", ".", "..", "^", "*", "-", + ":", "::", "=", ".", "..", "*", "-", "magic", "thread", "final", "profiler", "objchecks", "importcompilerproc", "importc", "exportc", "extern", "align", "nodecl", "pure", "volatile", "register", "sideeffect", |