nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

`pragma: foo` (eg: benign) should end up in index / documentation #10123

Open timotheecour opened 5 years ago

timotheecour commented 5 years ago

benign ends up all over the place (197 locations) yet we can't find it in nim docs (nor https://nim-lang.github.io/Nim/theindex.html) it's defined here:lib/system/inclrtl.nim

when defined(nimlocks):
  {.pragma: benign, gcsafe, locks: 0.}
else:
  {.pragma: benign, gcsafe.}

I'm guessing the problem is that {.pragma: foo.} isn't considered an exported symbol, however maybe there's something we could improve here, so that it would still end up in documentation ?

alaviss commented 5 years ago

Why would it need to be in the documentation? Is it referenced somewhere?

timotheecour commented 5 years ago

because it appears in so many places (197 for benign), so having it appear in documentation (would be done automatically for pragma definitions) would help anyone working in compiler/stdlib

Araq commented 5 years ago

System should list it manually in an ## section with the :idx annotation.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.

timotheecour commented 3 years ago

see also https://github.com/timotheecour/Nim/issues/146, more generally