parameters: (query, error)
return_statement: return wrappedquery, wrappederrorstring
docstring: Formats the given query and ParsingError, decorating the query at the
      position the error happened.
docstring_summary: Formats the given query and ParsingError, decorating the query at the
      position the error happened.
docstring_tokens: Formats the given query and ParsingError decorating the query at the position the error happened .
function: def formaterror(query, error):
      '''Formats the given query and ParsingError, decorating the query at the
      position the error happened.'''
      pos = error.position
      wrappedquery = wrap(query, [structs.Annotation(pos, pos + 1, 'error',
                                                     [structs.decorate.BACK])])
  
      wrappederrorstring = 'at position %d' % error.position
      epos = (len('at position '), len(wrappederrorstring))
      wrappederrorstring += ': %s.' % markupsafe.escape(error.message)
      wrappederrorstring = wrap(wrappederrorstring, [structs.Annotation(
          epos[0], epos[1], 'error', [structs.decorate.BACK])])
  
      return wrappedquery, wrappederrorstring
function_tokens: def formaterror ( query , error ) : pos = error . position wrappedquery = wrap ( query , [ structs . Annotation ( pos , pos + 1 , 'error' , [ structs . decorate . BACK ] ) ] ) wrappederrorstring = 'at position %d' % error . position epos = ( len ( 'at position ' ) , len ( wrappederrorstring ) ) wrappederrorstring += ': %s.' % markupsafe . escape ( error . message ) wrappederrorstring = wrap ( wrappederrorstring , [ structs . Annotation ( epos [ 0 ] , epos [ 1 ] , 'error' , [ structs . decorate . BACK ] ) ] ) return wrappedquery , wrappederrorstring