<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(code, filename='<unknown>', mode='exec', tree=None):
 """Parse the source into an AST node with PyPosAST. Enhance nodes with positions Arguments: code -- code text Keyword Arguments: filename -- code path mode -- execution mode (exec, eval, single) tree -- current tree, if it was optimized """

    visitor = Visitor(code, filename, mode, tree=tree)
    return visitor.tree