fixes #11436
This commit is contained in:
parent
79a23fe805
commit
296c48de5e
2 changed files with 6 additions and 4 deletions
|
|
@ -981,9 +981,10 @@ proc buildElse(n: PNode; o: Operators): PNode =
|
||||||
var s = newNodeIT(nkCurly, n.info, settype(n.sons[0]))
|
var s = newNodeIT(nkCurly, n.info, settype(n.sons[0]))
|
||||||
for i in 1..n.len-2:
|
for i in 1..n.len-2:
|
||||||
let branch = n.sons[i]
|
let branch = n.sons[i]
|
||||||
assert branch.kind == nkOfBranch
|
assert branch.kind != nkElse
|
||||||
for j in 0..branch.len-2:
|
if branch.kind == nkOfBranch:
|
||||||
s.add(branch.sons[j])
|
for j in 0..branch.len-2:
|
||||||
|
s.add(branch.sons[j])
|
||||||
result = newNodeI(nkCall, n.info, 3)
|
result = newNodeI(nkCall, n.info, 3)
|
||||||
result.sons[0] = newSymNode(o.opContains)
|
result.sons[0] = newSymNode(o.opContains)
|
||||||
result.sons[1] = s
|
result.sons[1] = s
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,8 @@ proc sourceLine*(conf: ConfigRef; i: TLineInfo): string =
|
||||||
proc writeSurroundingSrc(conf: ConfigRef; info: TLineInfo) =
|
proc writeSurroundingSrc(conf: ConfigRef; info: TLineInfo) =
|
||||||
const indent = " "
|
const indent = " "
|
||||||
msgWriteln(conf, indent & $sourceLine(conf, info))
|
msgWriteln(conf, indent & $sourceLine(conf, info))
|
||||||
msgWriteln(conf, indent & spaces(info.col) & '^')
|
if info.col >= 0:
|
||||||
|
msgWriteln(conf, indent & spaces(info.col) & '^')
|
||||||
|
|
||||||
proc formatMsg*(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg: string): string =
|
proc formatMsg*(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg: string): string =
|
||||||
let title = case msg
|
let title = case msg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue