pyccel.parser.extend_tree module#
Extended AST with CommentLine nodes#
- class pyccel.parser.extend_tree.CommentLine(s, lineno, col_offset)[source]View on GitHub#
Bases:
AST“New AST node representing a comment line
- pyccel.parser.extend_tree.extend_tree(code)[source]View on GitHub#
- pyccel.parser.extend_tree.get_comments(code)[source]View on GitHub#
Find all one-line comments in the code.
Find all one-line comments in the code and save them in a CommentLine object.
- Parameters:
code (str) – The original code being parsed.
- Returns:
The comments found in the code.
- Return type:
list[CommentLine]
- pyccel.parser.extend_tree.get_last_lineno(ast)[source]View on GitHub#
- pyccel.parser.extend_tree.insert_comments(ast, comment_lines_no, comments, else_no, attr='body', col_offset=None)[source]View on GitHub#