Xavier Claessens
3970f269fd
Fix assert(not true) raising backtrace
...
When no message is provided to assert(), it uses the ast printer to show
the condition that failed. In this case the 'not' is the first string
appended to the result, self.result[-1] would raise range error.
2021-06-16 19:04:03 -04:00
Daniel Mensinger
96eeef62ea
ast: Add AST JSON printer
2020-05-23 18:13:16 +02:00
Daniel Mensinger
d67888bf9b
types: Remove redundant __init__() -> None annotation
2020-03-02 10:52:59 +01:00
Daniel Mensinger
a75255bc4c
types: Annotate the AST visitors
2020-03-02 10:34:55 +01:00
Daniel Mensinger
c14aea2812
types: Annotate mparser.py
...
This also fixes that the keys in ArgumentNode.kwargs are
all of the type BaseNode now. Before this commit, it was
possible that both strings and Nodes where used as keys.
2020-03-02 10:34:55 +01:00
Xavier Claessens
552e78da4d
assert(): Make message argument optional
2019-12-10 18:02:41 +02:00
Daniel Mensinger
35b4ae5d61
ast: printer fix index node printing
2019-06-28 13:22:37 +02:00
Dylan Baker
346ab9f0d8
ast/printer: remove useless ternary
...
The ternary returns True or False from an expression that returns True
or False: i.e. True if bool(value) else False.
2019-04-25 12:28:51 -07:00
Daniel Mensinger
dbb94f122d
Fixed style issues
2019-01-24 21:38:29 +01:00
Daniel Mensinger
b7c6f3ec72
Can now rewrite files
2019-01-22 16:41:25 +01:00
Daniel Mensinger
277dc10a5d
AST post processing
2019-01-22 16:09:34 +01:00
Daniel Mensinger
46320bfba8
Added Ast printer
2019-01-22 16:09:34 +01:00
Daniel Mensinger
ccad493e85
Basic AST visitor pattern
2019-01-22 16:09:34 +01:00