Coder Social home page Coder Social logo

Comments (4)

wiggin77 avatar wiggin77 commented on August 15, 2024

I am looking at replacing my current regex-based function parsing with Simn's haxeparser. That should help deal with these scenarios.

Any thoughts on what should go in the comment? Outputting the whole struct definition there?

from codedox.

Gama11 avatar Gama11 commented on August 15, 2024

It should probably be the whole definition, since that's what the "type" is. In practice, you probably wouldn't want that (well, personally I wouldn't use ${type} for @param docs anyway) or use a typedef to begin with.

Note that with haxeparser, you will start to run into issues with conditional compilation - it behaves exactly like the Haxe compiler's parser, in that it throws away any #if blocks that are not active. It should still be more solid than what you currently have though. :)

from codedox.

Gama11 avatar Gama11 commented on August 15, 2024

And of course, the file actually needs to be parsable (which might not always be the case in a code editor context).

We need something that can a) deal with conditional compilation and b) is error robust as well for vshaxe eventually - @nadako has started working on something for that: https://github.com/nadako/crazyparser (not usable yet afaik)

from codedox.

wiggin77 avatar wiggin77 commented on August 15, 2024

I did run into the "code has to be parsable" issue already. So now I'm experimenting with extracting just the function to be documented, inserting that into a phony class declaration, and give that to the parser (since it does no seem to expose any ability to parse parts of documents).

If that fails parsing because the function is body is not valid yet then I will then replace the function body with something bogus and lose the ability to determine return type when not specified in the signature.

Thanks for the heads up on the #if issue.
We'll see how it goes.

from codedox.

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.