
    MhO                         d Z ddlZddlmZmZmZmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZ ddgZ G d de          Z G d	 de          Z G d
 de          ZdS )z
    pygments.lexers.vip
    ~~~~~~~~~~~~~~~~~~~

    Lexers for Visual Prolog & Grammar files.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerinheritwordsinclude)	TextCommentOperatorKeywordNameStringNumberPunctuation
WhitespaceVisualPrologLexerVisualPrologGrammarLexerc                      e Zd ZdZdZdZdef eedd          ej	        fdef eed	          ej	        fd
e
fde
fdej        j        fdej        fdej        fdefdedfdedfdej        dfdej        dfdej        dfdefdefdefg eedd          ej        fdefg ed          defd ed!fg ed          d"efded#fd$ed!fd%efgd&ej        fd'ej        fg ed(          dej        d!fd)efd*ej        j        d!fg ed(          dej        d!fd+efd*ej        j        d!fgd,ej        fdej        d!fd-efgd.Zd/S )0VisualPrologBaseLexer)tryforeachif)andcatchdoelseelseif	erroneous
externallyfailurefinallyr   r   ororelse	otherwisethenr   divmodremquot)shortdetailend
withdomainz\s+z\bend\s+\bprefixsuffixr*   r/   z0[xo][\da-fA-F_]+z(((\d[\d_]*)?\.)?\d[\d_]*([eE][\-+]?\d+)?z_\w*z[A-Z]\w*z@\w+z[a-z]\w*z/\*commentz\%commentline"stringz\'stringsinglez@"atstringz[\-+*^/!?<>=~:]+z[$,.[\]|(){}\\]+.@
commentdocz[^@\n]+$z#popz[^@*/]+z#pushz\*/z[*/]z\\u[0-9a-fA-F]{4}z\\[\'"ntr\\]stringescapez
[^\'\\\n]+z\nz	[^"\\\n]+z""z[^"]+)rootr9   r2   r1   r;   r5   r4   r6   N)__name__
__module____qualname__
minorendkw
minorkwexpdockwr   r   r
   Minorr   r   Variable	Anonymousr   r   Symbolr	   r   r   Preprocr   EscapeErrortokens     S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/vip.pyr   r      s4       )J6J4E Z U:k%@@@'-PWU:e,,,gm<!6*8&Adm-.$-(dm$$Wi(G]+6=(+FM>2FM:. (+ +.4L%
* U5e444goF7O

 GL!!!7F#
 GL!!!Wg&Wf%g
 "6=1fm,

 GN##FM6*F#FM'0	
 GN##6=&)6"FM'0	
 FM"6=&)v
k: :FFFrL   r   c                       e Zd ZdZdZdZdgZg dZdZdZ	dZ
d	Zd
 ee
d          ej        f ee	d          ef eedd          ej        fegiZd ZdS )r   zLexer for VisualProlog
    zVisual Prologhttps://www.visual-prolog.com/visualprolog)z*.proz*.clz*.iz*.packz*.ph2.17)goal	namespace	interfaceclass	implementwhereopeninheritssupportsresolvedelegatemonitor	constantsdomains
predicatesconstructors
propertiesclausesfacts)alignanyflowasbitsizedetermdigitsr   r   r   fromguardmulti	nondetermr    r!   r"   	procedurer[   single
suspending)
binincluder   r   endiferrorexportr   rk   grammargenerategrammarincluder   r   messageoptions
orrequiresrequiresstringincluder#   r<   r,   r0   #r-   c                 4    t          j        d|           rdS dS )zMCompetes with IDL and Prolog on *.pro; div. lisps on*.cl and SwigLexer on *.izc^\s*(end\s+(interface|class|implement)|(clauses|predicates|domains|facts|constants|properties)\s*$)\(\?r   researchtexts    rM   analyse_textzVisualPrologLexer.analyse_textn   s.    
 9{  ~B  C  C 	41rL   N)r=   r>   r?   __doc__nameurlaliases	filenamesversion_addedmajorkwminorkwdirectivekwr   r
   rC   	Directiver   rJ   r   rK   rL   rM   r   r   V   s         D
*CG:::IM~G{GK 	U75)))7=9U75)))73U;s59997;LM	
F    rL   c                       e Zd ZdZdZdZdgZdgZdZdZ	dZ
d	 ee	d
          ef ee
dd
          ej        fegiZd ZdS )r   z#Lexer for VisualProlog grammar
    zVisual Prolog GrammarrO   visualprologgrammarz*.vipgrmrQ   )rX   rS   grammarnonterminalsstartsymbols	terminalsrules
precedence)rr   r|   r<   r,   r0   r}   r-   c                 4    t          j        d|           rdS dS )zNo competditors (currently)zN^\s*(end\s+grammar|(nonterminals|startsymbols|terminals|rules|precedence)\s*$)r   r   r   r   s    rM   r   z%VisualPrologGrammarLexer.analyse_text   s$    
 9fhlmm 	41rL   N)r=   r>   r?   r   r   r   r   r   r   r   r   r   r
   r   r   rJ   r   rK   rL   rM   r   r   y   s          #D
*C$%GIMCG1KU75)))73U;s59997;LM
F    rL   )r   r   pygments.lexerr   r   r   r   pygments.tokenr   r   r	   r
   r   r   r   r   r   __all__r   r   r   rK   rL   rM   <module>r      sE    
			 > > > > > > > > > > > >$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $  :
;? ? ? ? ?J ? ? ?D         -      F    4     rL   