-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[parser] top-level comment
attached to wrong node, makes nim doc
buggy
#8929
Comments
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition nodecomment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition nodecomment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no comments
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no commentscomment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no comments and confuses nim doc
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no comments and confuses nim doc
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no comments; makes nim doc
buggy
comment
attached to nnkStmtList, should be attached to nnkProcDef top-level definition node; nnkRecList should have no comments; makes nim doc
buggycomment
attached to wrong node, makes nim doc
buggy
I don't think the AST is wrong, |
|
There is only
Where is this ambiguity? You simply claim there is one. |
/cc @Araq @zah
all entries below marked as BUG are bugs IMO. The compiler should fix where the comment nodes go and nim doc should be updated accordingly (instead of just working around these inconsistencies in
nim doc
)top-level proc
comment
attached to nnkStmtList instead of nnkProcDefLikewise with template, macro, iterator, type etc.
comment attached to nnkRecList in object definition instead of nnkObjectTy
this case is also bizarre: shouldn't the following code give compile error? instead, it attaches a comment to nnkRecList (IMO there should be no comment attached to nnkRecList)
Note: this is inconsistent with enum and named tuple, which both behave sanely:
nim doc
currently buggy because of comments in nnkRecListthis is how
Foo5
renders in html:as you can see the
nnkRecList
comment hijacks the comment for the 1st field, a1.nim doc
currently buggy because top-level comment attached to nnkStmtList in a procnim doc
is trying to work around above mentioned parser bug by trying to attach first stmt in nnkStmtList if it's a nnkCommentStmt and if proc doesn't already have a comment; this workaround causes issues in following case, see myfun5.There's inherent ambiguity in current approach, and my proposal would eliminate this workaround, this bug, and all ambiguity:
in fun5, a statement comment ends up in generated html as doc comment for the proc
doc generated:
proposal
nim doc
and automatically fix the above mentioned nim doc bugsThe text was updated successfully, but these errors were encountered: