old pointer deref operator completely removed
This commit is contained in:
parent
246b8d18a1
commit
a6daf71520
12 changed files with 83 additions and 20 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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, "`")
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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]))
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue