
    =wg	                     \    d Z ddlZddlmZ  G d de      Zd Zd Zej                  fdZ	y)	z[
This module contains common utility objects/functions for the other query
parser modules.
    N)string_typec                         e Zd Zd fd	Z xZS )QueryParserErrorc                 L    t         t        |   t        |             || _        y N)superr   __init__strcause)selfr   msg	__class__s      L/var/www/horilla/myenv/lib/python3.12/site-packages/whoosh/qparser/common.pyr	   zQueryParserError.__init__'   s    .s5z:
    r   )__name__
__module____qualname__r	   __classcell__)r   s   @r   r   r   &   s     r   r   c                 >     | j                   |fddi|D ]  }|c S  y)z7Returns the first token from an analyzer's output.
    modequeryN)process_text)fieldtextkwargsts       r   get_single_textr   ,   s/      U=7=f= r   c                     | r%	 |j                   | _         |j                  | _        | S | S # t        $ r# t        d| j                  j                  z        w xY w)NzCan't set attribute on %s)	startcharendcharAttributeErrorr   r   )qstxnodes     r   attachr$   4   s`    	9!++AKAI H1H  	9 !<#$;;#7#7"8 9 9	9s	   "* ,Ac                 B    | r|j                  d| dz
  z  |d       y y )N    
)write)levelr   outs      r   print_debugr,   ?   s$    		cUQY/56 r   )
__doc__syswhoosh.compatr   	Exceptionr   r   r$   stderrr,    r   r   <module>r3      s6   8
  %y  !$

 7r   