U
    e»{j¡	  ã                   @   sX   d dl Z d dlZd dlmZ d dlZd dlmZ dd„ Zejj	ej
 dd�dd	„ ƒZdS )
é    N)Údedent)Ú_TAB_HEADERc                   C   s   dS )z,Docstring that's here just to check for -OO.N© r   r   r   ú_/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/utils/tests/test_parsing.pyÚ_docstring_canary   s    r   zTest cannot be run with -OO)Úreasonc                 C   s  t  d¡}| d|› d� }| td|› d|› d�ƒ¡ | d|› d� }| td|› d	|› d�ƒ¡ | | ¡ t d|› �¡}| ¡ }t d|› �¡}| ¡ }|j	d
|d�}	|	dks¶t
‚| d|› d�  ¡ }
|
 tjd|› �d�¡sæt
‚| d|› d�  ¡ }| tjd|› �d�¡�st
‚d S )Né   Ztest_parsing_lexer_z.pya/  
        from astropy.utils.parsing import lex

        def make_lexer():
            tokens = ('NUMBER', 'PLUS')
            t_PLUS = r'\+'

            def t_NUMBER(t):
                r'\d+'
                t.value = int(t.value)
                return t

            return lex('test_parsing_lextab_z', 'test_parsing_lexer_z')
        Ztest_parsing_parser_a�  
        from astropy.utils.parsing import yacc

        def make_parser():
            tokens = ('NUMBER', 'PLUS')

            def p_expression_number(p):
                'expression : NUMBER'
                p[0] = p[1]

            def p_expression_plus(p):
                'expression : expression PLUS NUMBER'
                p[0] = p[1] + p[3]

            return yacc('test_parsing_parsetab_z', 'test_parsing_parser_z1+2+3)Úlexeré   Ztest_parsing_lextab_)ÚpackageZtest_parsing_parsetab_)ÚsecretsZ	token_hexÚ
write_textr   Zsyspath_prependÚ	importlibÚimport_moduleZ
make_lexerZmake_parserÚparseÚAssertionErrorÚ	read_textÚ
startswithr   Úformat)Ztmp_pathZmonkeypatchÚsuffixZ
lexer_fileZparser_fileZ	lexer_modr	   Z
parser_modÚparserÚresultZlextabZparsetabr   r   r   Útest_generate_parser   sD    
ôôÿÿòòÿÿ
ÿr   )r   r   Útextwrapr   ZpytestZastropy.utils.parsingr   r   ÚmarkZskipifÚ__doc__r   r   r   r   r   Ú<module>   s   