Closed rkaminsk closed 1 year ago
@teiesti, could you have a look if this suits your application?
I am going to have a look.
I was able to make the following work on my machine which looks very promising.
>>> parse_string("%comment\nfact.", lambda ast: print(repr(ast)))
ast.Program(Location(begin=Position(filename='<string>', line=1, column=1), end=Position(filename='<string>', line=1, column=1)), 'base', [])
ast.Comment(Location(begin=Position(filename='<string>', line=1, column=1), end=Position(filename='<string>', line=1, column=9)), '%comment', 0)
ast.Rule(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=6)), ast.Literal(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=5)), 0, ast.SymbolicAtom(ast.Function(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=5)), 'fact', [], 0))), [])
I can't wait to see this being stabilized. Thanks for the effort!
Anyhow, I would like to see the pdoc documentation. Is there an easy way to generate it?
@susuhahnml You may also want to look through this!
I was able to make the following work on my machine which looks very promising.
>>> parse_string("%comment\nfact.", lambda ast: print(repr(ast))) ast.Program(Location(begin=Position(filename='<string>', line=1, column=1), end=Position(filename='<string>', line=1, column=1)), 'base', []) ast.Comment(Location(begin=Position(filename='<string>', line=1, column=1), end=Position(filename='<string>', line=1, column=9)), '%comment', 0) ast.Rule(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=6)), ast.Literal(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=5)), 0, ast.SymbolicAtom(ast.Function(Location(begin=Position(filename='<string>', line=2, column=1), end=Position(filename='<string>', line=2, column=5)), 'fact', [], 0))), [])
I can't wait to see this being stabilized. Thanks for the effort!
Anyhow, I would like to see the pdoc documentation. Is there an easy way to generate it?
https://pdoc3.github.io/pdoc/doc/pdoc/#command-line-interface
There is not much to document though. It is just one additional type added to the AST.
@teiesti, @susuhahnml, this should be ready. You can already try using the development packages on ubuntu/anaconda/pypi test. -R
think about option to ignore comment ASTsThe snippet below shows some issues that should still (or not) be addressed before merging: