mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
* stdlib tests now check refc too * typo * fixes line numbers * disable cpp * do not touch
31 lines
595 B
Nim
31 lines
595 B
Nim
discard """
|
|
targets: "c cpp"
|
|
matrix: "--mm:refc; --mm:arc"
|
|
"""
|
|
|
|
type
|
|
GlobNodeKind = enum
|
|
LiteralIdent,
|
|
Group
|
|
|
|
GlobNode = object
|
|
case kind: GlobNodeKind
|
|
of LiteralIdent:
|
|
value: string
|
|
of Group:
|
|
values: seq[string]
|
|
|
|
PathSegment = object
|
|
children: seq[GlobNode]
|
|
|
|
GlobPattern = seq[PathSegment]
|
|
|
|
proc parseImpl(): GlobPattern =
|
|
if result.len == 0:
|
|
result.add PathSegment()
|
|
result[^1].children.add GlobNode(kind: LiteralIdent)
|
|
|
|
block:
|
|
const pattern = parseImpl()
|
|
doAssert $pattern == """@[(children: @[(kind: LiteralIdent, value: "")])]"""
|