GithubHelp home page GithubHelp logo

Comments (4)

omarkhan avatar omarkhan commented on July 29, 2024

https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words

Check the end of lexer.coffee from the coffeescript source. It throws an error at compile time to avoid generating bad javascript.

Golden rule: make sure your code runs before passing it through coffeedoc.

from coffeedoc.

KirillTemnov avatar KirillTemnov commented on July 29, 2024

You are correct, I've used local private variable and after change it documentation was generated.

On the other hand, your "Golder rule" is not relevant to this situation - code, that generate this error works fine even with private variable, and I don't give you reason for making so sure, that my code not works.

Resume:
Your documentation generator fails on valid code (at least coffee script lexer thinks so), that may mean, that
you using coffee script lexer on slightly different manner, that was assumed by design.

In this case I think you may add warnings to code, that used uncorrect, but valid syntax.

I could even add patch to your code, if you need it.

from coffeedoc.

omarkhan avatar omarkhan commented on July 29, 2024

The code is not valid. If you run this, the coffeescript lexer will throw an error:

private = 'invalid'  # fails

Coffeedoc uses coffeescript to generate an AST from source files. If it's not valid coffeescript, it will fail. It's not trying to be a code quality tool - you can use something like coffeelint for that, or run your source through coffee --lint to check the compiled js.

Check the coffeescript source here for details: https://github.com/jashkenas/coffee-script/blob/master/src/lexer.coffee#L578

from coffeedoc.

KirillTemnov avatar KirillTemnov commented on July 29, 2024

Thanks for coffee lint, I've check and found 'private' vars problems.

But when I lanched this code via coffescrit it was work as expected (I don't compile it to javascript),
that's strange...

from coffeedoc.

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.