
    |e.                     h    d Z ddlZddl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gZ G d de      Zy)z
    pygments.lexers.nix
    ~~~~~~~~~~~~~~~~~~~

    Lexers for the NixOS Nix language.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerinclude)	TextCommentOperatorKeywordNameStringNumberPunctuationLiteralNixLexerc                      e Zd ZdZdZdZddgZdgZdgZg dZ	g d	Z
g d
Zg dZdej                  fdej                  dfdefddj#                  d e	D              z  efddj#                  d e
D              z  ej(                  fdej*                  fdej.                  fdej0                  fdefdefdefddj#                  d eD              z  efdej6                  fdedfddj#                  d eD              z  efdej<                  d fd!ej                  d"fd#efd$ej>                  fd%efd&ej@                  d'fgd(ej                  fdej                  d)fd*ej                  d+fd,ej                  fgd-ejB                  fd!ej                  d+fd&ej@                  d'fd.ej                  fd/ej                  fd0ej                  fd1ej                  fgd2ejB                  fdej<                  d+fd&ej@                  d'fd3ej<                  fd4ej<                  fd5ej<                  fd6ej<                  fgd7ej@                  d+fd&ej@                  d)f e"d8      gd7ed+f e"d8      gd9Z#d: Z$y;)<r   z:
    For the Nix language.

    .. versionadded:: 2.0
    Nixzhttp://nixos.org/nix/nixosnixz*.nixz
text/x-nix)
recwithletininheritassertifelsethenz...)importabort
baseNameOfdirOfisNullbuiltinsmapremoveAttrsthrowtoString
derivation)z+++?.!z//z==/z!=z&&z||z->=<>*-)
()[];{}:,@z#.*$z/\*commentz\s+z(%s)|c              #   L   K   | ]  }t        j                  |      d z     ywz\bNreescape.0entrys     5/usr/lib/python3/dist-packages/pygments/lexers/nix.py	<genexpr>zNixLexer.<genexpr>6        NEryy/%7N   "$c              #   L   K   | ]  }t        j                  |      d z     ywr>   r?   rB   s     rE   rF   zNixLexer.<genexpr>9   rG   rH   z\b(true|false|null)\bz!-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?z-?[0-9]+z[\w.+-]*(\/[\w.+-]+)+z~(\/[\w.+-]+)+z\<[\w.+-]+(\/[\w.+-]+)*\>c              #   F   K   | ]  }t        j                  |        y wNr?   rB   s     rE   rF   zNixLexer.<genexpr>J   s     GEryy/G   !z\b(or|and)\bz\{blockc              #   F   K   | ]  }t        j                  |        y wrK   r?   rB   s     rE   rF   zNixLexer.<genexpr>S   s     JEryy/JrL   "doublequotez''	multilinez4[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+z[\w-]+(?=\s*=)z[a-zA-Z_][\w\'-]*z\$\{	antiquotez[^/*]+z#pushz\*/z#popz[*/]z''(\$|'|\\n|\\r|\\t|\\)z[^'\$]+z\$[^\{']z'[^']z\$(?=')z\\(\\|"|\$|n)z	[^"\\\$]+z\$[^\{"]z\$(?=")z\\z\}root)rS   r;   rQ   rP   rR   rM   c                     d}t        j                  d|       r|dz  }t        j                  d|       r|dz  }t        j                  d|       r|dz  }t        j                  d|       r|dz  }|S )Ng        zimport.+?<[^>]+>g?zmkDerivation\s+(\(|\{|rec)z=\s+mkIf\s+z\{[a-zA-Z,\s]+\}:g?)r@   search)textrvs     rE   analyse_textzNixLexer.analyse_text   sk    99($/#IB992D9#IB99^T*#IB99)40#IB	    N)%__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypeskeywordsr!   	operatorspunctuationsr   Single	Multiliner   joinr   r	   BuiltinConstantr   FloatIntegerr   r   Wordr   r
   DoubleSymbolInterpolEscaper   tokensrX    rY   rE   r   r      s    D
!CG	II'HIHBI FL
 gnn% W&&	2 TN chhNXNNNPWX chhNXNNN\\ &t}}5 26<<@ &..) &w/()73 chhGYGGG hmm,K) chhJ\JJJKX 6==-0F$$k2 EgN .!4(foo{3k6
p ))*W&&0W&&/g''(	
 (7F$$f-foo{3))*&**+v''())*
 v}}-6==&)foo{36==)&--('FMM"
 FOOV,foow/FO	
 K(FO
mZFxrY   )r]   r@   pygments.lexerr   r   pygments.tokenr   r   r   r   r	   r
   r   r   r   __all__r   rs   rY   rE   <module>rw      s8    
 .! ! ! ,}z }rY   