syntax icon indicating copy to clipboard operation
syntax copied to clipboard

resdoc: add support for .ml and .res files

Open Minnozz opened this issue 4 years ago • 4 comments
trafficstars

Building on the experimental-docgen branch.

Fixes rescript-association/rescript-lang.org#359

Minnozz avatar Jun 19 '21 22:06 Minnozz

A problem with the current Ast_iterator approach for structure files is that it recurses into functions, while we only want to document top level stuff.

I've been looking at a way to convert a structure into a signature, but I can't find it in the codebase. However, the new dump subcommand does something similar. Maybe we can use that?

Minnozz avatar Jun 26 '21 08:06 Minnozz

  • Regarding Ast_iterator, maybe it's ok to just write your own recursive functions that walk the tree? This way you have full control.

  • Converting a structure into a signature is not possible without access to the type checker.

IwanKaramazow avatar Jun 26 '21 08:06 IwanKaramazow

@IwanKaramazow Thanks for the tips!

I initially thought using Ast_iterator would be better, but I think I'll revert to @ryyppy's approach.

Minnozz avatar Jun 26 '21 09:06 Minnozz

(Random thought: Control flow is one of the only tools we have as programmers, sometimes it's not worth to give it up.)

IwanKaramazow avatar Jun 27 '21 09:06 IwanKaramazow

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 28 '23 08:05 stale[bot]