bjpop / language-python

A parser for Python 2.x and 3.x written in Haskell
157 stars 46 forks source link

Documentation request: Python AST #44

Open dopatraman opened 5 years ago

dopatraman commented 5 years ago

Is it possible to document the target AST? Would help while contributing.

Not sure on the format most folks would find useful -- personally, I'd be a fan of a JSON blob where:

x = 1

is represented by

{
    "type": "expression",
    "operator": "assignment",
    "variable": "x",
    "value": "1"
}

Would this be useful for anyone?

bjpop commented 5 years ago

I think documentation in the form of some examples would be very helpful, yes.

Can it be done with normal Haddock style comments in the source code? https://github.com/bjpop/language-python/blob/master/src/Language/Python/Common/AST.hs

I'm not sure about the JSON style. Perhaps you can elaborate on why that would be a good way to do it?

I would be very happy to accept pull requests for documentation.