diff options
author | flywind <xzsflywind@gmail.com> | 2022-01-13 15:03:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 08:03:14 +0100 |
commit | ada815e45957e5675a9ac978b85b8467d68c5945 (patch) | |
tree | e5a6baefc12fc0e1c8fcdec0a02293060a5f9ee5 /lib | |
parent | 9a32905d89d23e423bca2d0ce643b9331a6741c0 (diff) | |
download | Nim-ada815e45957e5675a9ac978b85b8467d68c5945.tar.gz |
make rst thread safe (#19369)
split for the convenience of review
Diffstat (limited to 'lib')
-rw-r--r-- | lib/packages/docutils/rst.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim index a04eb696f..791953767 100644 --- a/lib/packages/docutils/rst.nim +++ b/lib/packages/docutils/rst.nim @@ -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. @@ -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): @@ -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 |