crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.26k stars 1.61k forks source link

Fix enable docs for builtin constants #14571

Closed straight-shoota closed 2 months ago

straight-shoota commented 2 months ago

The builtins are created inside the initializer. At this point wants_doc? is always false becase the doc generator only set it to true after the initializer.

I don't think there's any noticable impact from having a dozend doc strings assigned in every program AST, even without wants_doc. Skipping docs is an optimization that pays out when parsing huge program ASTs. But for these few doc strings, there shouldn't be any issue. The doc strings are literals, so they don't even occupy any memory (not that it would hurt much if it did).

Follow-up to #14276