Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mark_tokens(self, root_node):
"""
Given the root of the AST tree produced from source_text, visits all nodes marking them with
token and position information by adding .first_token and .last_token attributes.
"""
AssignFirstTokens(self).visit_tree(root_node)
AssignLastTokens(self).visit_tree(root_node)