Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rst: add missing line/column info for some warnings #18383

Merged
merged 29 commits into from
Jul 20, 2021
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f7fa825
rst: add missing line/column info for some warnings
a-mr Jun 28, 2021
e64c7fb
add workaround
a-mr Jun 28, 2021
af49d7b
use TLineInfo/FileIndex for storing file names
a-mr Jul 2, 2021
1b31d61
fix blank lines in include file (rm harmful strip)
a-mr Jul 2, 2021
80cafde
don't use ref TLineInfo
a-mr Jul 3, 2021
ce5de16
return `hasToc` as output parameter for uniformity
a-mr Jul 6, 2021
ed47dbd
Update compiler/docgen.nim
a-mr Jul 7, 2021
cf27ed9
Update compiler/docgen.nim
a-mr Jul 7, 2021
19fa19e
Update lib/packages/docutils/rst.nim
a-mr Jul 7, 2021
b361cd3
address review - stylistic things
a-mr Jul 7, 2021
4d20a5f
Update compiler/docgen.nim
a-mr Jul 7, 2021
d13c14d
unify RST warnings/errors names
a-mr Jul 7, 2021
98b4d0d
doAssert + minor name change
a-mr Jul 8, 2021
1e633aa
fix a bug caught by doAssert
a-mr Jul 8, 2021
f7bb08c
apply strbasics.strip to final HTML/Latex
a-mr Jul 8, 2021
ae2083b
rm redundant filename
a-mr Jul 10, 2021
e8ede97
fix test after rebase
a-mr Jul 11, 2021
f784222
delete `order` from rnFootnoteRef,
a-mr Jul 15, 2021
b56d6c0
Update compiler/lineinfos.nim
a-mr Jul 15, 2021
22c254d
Update lib/packages/docutils/rstast.nim
a-mr Jul 15, 2021
a0a9ae1
Update lib/packages/docutils/rstast.nim
a-mr Jul 15, 2021
d52ce1f
Update lib/packages/docutils/rstast.nim
a-mr Jul 15, 2021
12dde3d
revert because of error:
a-mr Jul 15, 2021
769d367
Update lib/packages/docutils/rstgen.nim
a-mr Jul 15, 2021
4c5dc1c
apply suggestion
a-mr Jul 15, 2021
209c72e
Update lib/packages/docutils/rst.nim
a-mr Jul 15, 2021
3d5f903
add Table for string->file name mapping
a-mr Jul 17, 2021
cc0df0b
do not import compiler/lineinfos
narimiran Jul 19, 2021
9c709be
fix ambiguous calls
narimiran Jul 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doAssert + minor name change
a-mr committed Jul 11, 2021
commit 98b4d0deaca5b8aa390b7e894ffb41d92922e615
2 changes: 1 addition & 1 deletion compiler/docgen.nim
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ template declareClosures =
of meCannotOpenFile: k = errCannotOpenFile
of meExpected: k = errXExpected
of meGridTableNotImplemented: k = errRstGridTableNotImplemented
of meMarkdownIllformedTable: k = errMarkdownIllformedTable
of meMarkdownIllformedTable: k = errRstMarkdownIllformedTable
of meNewSectionExpected: k = errRstNewSectionExpected
of meGeneralParseError: k = errRstGeneralParseError
of meInvalidDirective: k = errRstInvalidDirectiveX
4 changes: 2 additions & 2 deletions compiler/lineinfos.nim
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ type
errIllFormedAstX, errCannotOpenFile,
errXExpected,
errRstGridTableNotImplemented,
errMarkdownIllformedTable,
errRstMarkdownIllformedTable,
errRstNewSectionExpected,
errRstGeneralParseError,
errRstInvalidDirectiveX,
@@ -97,7 +97,7 @@ const
errCannotOpenFile: "cannot open '$1'",
errXExpected: "'$1' expected",
errRstGridTableNotImplemented: "grid table is not implemented",
errMarkdownIllformedTable: "illformed delimiter row of a markdown table",
errRstMarkdownIllformedTable: "illformed delimiter row of a markdown table",
errRstNewSectionExpected: "new section expected $1",
errRstGeneralParseError: "general parse error",
errRstInvalidDirectiveX: "invalid directive: '$1'",
7 changes: 3 additions & 4 deletions lib/packages/docutils/rst.nim
Original file line number Diff line number Diff line change
@@ -592,10 +592,9 @@ proc setCurrFilename(s: PRstSharedState, file1: string) =
s.currFileIdx = (s.filenames.len - 1).FileIndex

proc getFilename(filenames: seq[string], fid: FileIndex): string =
if fid.int < filenames.len:
result = filenames[fid.int]
else:
result = "input"
doAssert(0 <= fid.int and fid.int < filenames.len,
"incorrect FileIndex $1 (range 0..$2)" % [$fid.int, $(filenames.len-1)])
result = filenames[fid.int]

proc currFilename(s: PRstSharedState): string =
getFilename(s.filenames, s.currFileIdx)