Support doc comments in new-styled concepts (#20752)

Support comments in new-styled concepts
This commit is contained in:
konsumlamm 2022-11-04 13:32:41 +01:00 • committed by GitHub
commit 4491da4c4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -61,6 +61,8 @@ proc semConceptDecl(c: PContext; n: PNode): PNode =
for i in 0..<n.len-1: for i in 0..<n.len-1:
result[i] = n[i] result[i] = n[i]
result[^1] = semConceptDecl(c, n[^1]) result[^1] = semConceptDecl(c, n[^1])
of nkCommentStmt:
discard
else: else:
localError(c.config, n.info, "unexpected construct in the new-styled concept: " & renderTree(n)) localError(c.config, n.info, "unexpected construct in the new-styled concept: " & renderTree(n))
result = n result = n

View file

@ -0,0 +1,3 @@
type Foo = concept
## doc comment
proc foo(x: Self)