horast icon indicating copy to clipboard operation
horast copied to clipboard

Human-oriented abstract syntax tree (AST) parser/unparser for Python 3 that doesn't discard comments.

Results 4 horast issues
Sort by recently updated
recently updated
newest added

I was getting an `AssertionError` because of this [comment](https://github.com/robofit/arcor2/blob/b436488c7042e7f7dd31ac465dd2f03b269e7ca8/src/python/arcor2_fit_demo/object_types/dobot_magician.py#L51). With the comment gone, the error was also gone. Also, everything seems to be ok with the comment on its original...

Following simple test fails: ```py import horast import inspect class Test: """ multiline docstring """ original_code = inspect.getsource(Test) tree = horast.parse(original_code) unparsed_code = horast.unparse(tree) assert original_code == unparsed_code ``` because...

If the following code: ``` class foo: def bar(self): # whatever comment pass bar.__baz__ = None # type: ignore ``` is passed to ```horast.parse```, an AssertionError is raised: ``` Traceback...

Horast fails to parse correctly for inline comments embedded in fluent-style blocks ``` horast.parse(""" x = (spark_rdd # Increate by one .map(lambda x: x+1) # Sum it all .reduce(lambda x,...