Coder Social home page Coder Social logo

Comments (3)

cristianoc avatar cristianoc commented on June 8, 2024

@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.

Et7f3 avatar Et7f3 commented on June 8, 2024

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.

cristianoc avatar cristianoc commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.