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

make rst thread safe #19369

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions lib/packages/docutils/rst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@ type
DirFlag = enum
hasArg, hasOptions, argIsFile, argIsWord
DirFlags = set[DirFlag]
SectionParser = proc (p: var RstParser): PRstNode {.nimcall.}
SectionParser = proc (p: var RstParser): PRstNode {.nimcall, gcsafe.}

proc parseDirective(p: var RstParser, k: RstNodeKind, flags: DirFlags): PRstNode =
## Parses arguments and options for a directive block.
Expand Down Expand Up @@ -2869,7 +2869,7 @@ proc indFollows(p: RstParser): bool =
result = currentTok(p).kind == tkIndent and currentTok(p).ival > currInd(p)

proc parseBlockContent(p: var RstParser, father: var PRstNode,
contentParser: SectionParser): bool =
contentParser: SectionParser): bool {.gcsafe.} =
## parse the final content part of explicit markup blocks (directives,
## footnotes, etc). Returns true if succeeded.
if currentTok(p).kind != tkIndent or indFollows(p):
Expand Down Expand Up @@ -3123,7 +3123,7 @@ proc prefix(ftnType: FootnoteType): string =
of fnAutoSymbol: result = "footnotesym-"
of fnCitation: result = "citation-"

proc parseFootnote(p: var RstParser): PRstNode =
proc parseFootnote(p: var RstParser): PRstNode {.gcsafe.} =
## Parses footnotes and citations, always returns 2 sons:
##
## 1) footnote label, always containing rnInner with 1 or more sons
Expand Down