(query, error)
return wrappedquery, wrappederrorstring
Formats the given query and ParsingError, decorating the query at the
    position the error happened.
Formats the given query and ParsingError, decorating the query at the
    position the error happened.
Formats the given query and ParsingError decorating the query at the position the error happened .
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
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