close #16646; since now works with bootstrap nim post csources_v1 (#17895)

* revive #16627 now that csources_v1 was merged

* use dedent in rst.nim, refs https://github.com/nim-lang/Nim/pull/17257#discussion_r589025683

* fix test and improve rendering of a rst warning
This commit is contained in:
Timothee Cour 2021-04-30 09:54:47 -07:00 • committed by GitHub
commit 3192995ac9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View file

@ -256,8 +256,8 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType =
else: else:
result.n.add semConstExpr(c, range[i]) result.n.add semConstExpr(c, range[i])
if (result.n[0].kind in {nkFloatLit..nkFloat64Lit} and classify(result.n[0].floatVal) == fcNan) or if (result.n[0].kind in {nkFloatLit..nkFloat64Lit} and result.n[0].floatVal.isNaN) or
(result.n[1].kind in {nkFloatLit..nkFloat64Lit} and classify(result.n[1].floatVal) == fcNan): (result.n[1].kind in {nkFloatLit..nkFloat64Lit} and result.n[1].floatVal.isNaN):
localError(c.config, n.info, "NaN is not a valid start or end for a range") localError(c.config, n.info, "NaN is not a valid start or end for a range")
if weakLeValue(result.n[0], result.n[1]) == impNo: if weakLeValue(result.n[0], result.n[1]) == impNo:

View file

@ -2253,8 +2253,7 @@ proc parseEnumList(p: var RstParser): PRstNode =
(should be at column $3 if it's a continuation of enum. list), (should be at column $3 if it's a continuation of enum. list),
or no blank line after line $1 (if it should be the next paragraph), or no blank line after line $1 (if it should be the next paragraph),
or no escaping \ at the beginning of line $1 or no escaping \ at the beginning of line $1
(if lines $1..$2 are a normal paragraph, not enum. list)""". (if lines $1..$2 are a normal paragraph, not enum. list)""".dedent
unindent(8)
let c = p.col + requiredIndent + ColRstOffset let c = p.col + requiredIndent + ColRstOffset
rstMessage(p, mwRstStyle, msg % [$(n-1), $n, $c], rstMessage(p, mwRstStyle, msg % [$(n-1), $n, $c],
p.tok[j].line, p.tok[j].col) p.tok[j].line, p.tok[j].col)