Comments (3)
@Et7f3 one issue with doc comments is how to read them from libraries.
In the case of bucklescript, libraries are in a conventional place.
But in the case of native, libraries are wherever the build system looks for them (dune, or dune + esy), and it would be complex to replicate the same logic here.
What is definitely doable, is to do a one-off compilation of a library to extract the annotations, then use that to populate the tables vendored with he analysis.
from reanalyze.
one issue with doc comments is how to read them from libraries.
# (*comment*);;
# (**comment*);;
Ptop_def
[]
Ptop_def
[
structure_item (//toplevel//[1,0+0]..[1,0+12])
Pstr_attribute "ocaml.text"
[
structure_item (//toplevel//[1,0+0]..[1,0+12])
Pstr_eval
expression (//toplevel//[1,0+0]..[1,0+12])
Pexp_constant PConst_string("comment",None)
]
]
We can see that doc comment are preserved in the ast.
if comment are in interface file: then their is a .cmti/.cmi next to the implementation corresponding .cmt/.cmo.
it would be complex to replicate the same logic here.
So the logic is quite simple (remove the 'o' if it is last char and add 'i')
from reanalyze.
I think what's possible is a bootstrapping process, where doc comments can be used as a starting point. However, some manual tweaking has already been necessary:
("blit_string", [invalidArgument]),
// ("concat", [invalidArgument]), if longer than {!Sys.max_string_length}
// ("cat", [invalidArgument]), if longer than {!Sys.max_string_length}
// ("escaped", [invalidArgument]), if longer than {!Sys.max_string_length}
("index", [notFound]),
where the commented-out functions would lead to mostly noise.
from reanalyze.
Related Issues (20)
- `-write` removes trailing newline from modified file
- Binding operators are incorrectly marked dead HOT 1
- Use single dead annotation if entire module is unused
- Awkward record field dead attribute placement with unusual record formatting HOT 3
- Re-exported variant is incorrectly marked dead HOT 1
- Interpret OCaml compiler's unused value declaration warning suppression attribute HOT 1
- Confusing dead code warning at module include HOT 1
- When a function is annotated `@dead` values inside it are reported dead. HOT 10
- Module incorrectly marked dead when contains non-dead type and submodule definitions HOT 1
- @dead annotation breaks rescript compiler on a destructured value HOT 3
- decorating functions in pipe chains? HOT 4
- Dead Types wrt consumed types HOT 7
- False alarms for native projects that generate new files HOT 9
- [Feature Request] Support `globs` for `suppress` and `unsuppress`.
- [Feature request] Integrate with `@deriving({abstract: light})` HOT 13
- Interface of sub module are not seen used HOT 3
- -write produces syntax error in OCaml w.r.t. destructive substitution on module-items and tuple pattern-matching HOT 4
- Catching on exception from other module leads to incorrect warning HOT 3
- Include Darwin arm64 builds in the NPM package HOT 5
- False Positive When Using First Class Module Type Alias
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reanalyze.