Skip to content

Commit 34d42d9

Browse files
nigredo-torioprypin
authored andcommitted
Mark docopt() gcsafe (#24)
1 parent b541dee commit 34d42d9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/docopt.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ method match(self: Pattern, left: seq[Pattern],
106106
collected: seq[Pattern] = @[]): MatchResult {.base.} =
107107
assert false
108108

109-
method fix_identities(self: Pattern, uniq: seq[Pattern]) {.base.} =
109+
method fix_identities(self: Pattern, uniq: seq[Pattern]) {.base, gcsafe.} =
110110
## Make pattern-tree tips point to same object if they are equal.
111111
if self.children.is_nil:
112112
return
@@ -426,7 +426,7 @@ proc parse_shorts(tokens: TokenStream, options: var seq[Option]): seq[Pattern] =
426426
result.add o
427427

428428

429-
proc parse_expr(tokens: TokenStream, options: var seq[Option]): seq[Pattern]
429+
proc parse_expr(tokens: TokenStream, options: var seq[Option]): seq[Pattern] {.gcsafe.}
430430

431431
proc parse_pattern(source: string, options: var seq[Option]): Required =
432432
var tokens = token_stream(
@@ -440,7 +440,7 @@ proc parse_pattern(source: string, options: var seq[Option]): Required =
440440
required(ret)
441441

442442

443-
proc parse_seq(tokens: TokenStream, options: var seq[Option]): seq[Pattern]
443+
proc parse_seq(tokens: TokenStream, options: var seq[Option]): seq[Pattern] {.gcsafe.}
444444

445445
proc parse_expr(tokens: TokenStream, options: var seq[Option]): seq[Pattern] =
446446
## expr ::= seq ( '|' seq )* ;
@@ -456,7 +456,7 @@ proc parse_expr(tokens: TokenStream, options: var seq[Option]): seq[Pattern] =
456456

457457

458458

459-
proc parse_atom(tokens: TokenStream, options: var seq[Option]): seq[Pattern]
459+
proc parse_atom(tokens: TokenStream, options: var seq[Option]): seq[Pattern] {.gcsafe.}
460460

461461
proc parse_seq(tokens: TokenStream, options: var seq[Option]): seq[Pattern] =
462462
## seq ::= ( atom [ '...' ] )* ;
@@ -601,7 +601,7 @@ proc docopt_exc(doc: string, argv: seq[string], help: bool, version: string,
601601
602602
proc docopt*(doc: string, argv: seq[string] = nil, help = true,
603603
version: string = nil, options_first = false, quit = true
604-
): Table[string, Value] =
604+
): Table[string, Value] {.gcsafe.} =
605605
## Parse `argv` based on command-line interface described in `doc`.
606606
##
607607
## `docopt` creates your command-line interface based on its

test/nim.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ linedir = on
44
debuginfo
55
stacktrace = on
66
linetrace = on
7+
threads = on

0 commit comments

Comments
 (0)