Filter out None from parsed blocks
This allows for comments to not appear in the generated AST.
This commit is contained in:
parent
70227394b0
commit
f0f03f745b
@ -6,7 +6,8 @@ def lineno_from_parseinfo(parseinfo):
|
||||
|
||||
def parse(ast):
|
||||
if isinstance(ast, list):
|
||||
return [parse(item) for item in ast]
|
||||
nodes = (parse(item) for item in ast)
|
||||
return [node for node in nodes if node is not None]
|
||||
|
||||
if isinstance(ast, str):
|
||||
return parse_output(ast)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user