a
    b&                     @   s@   d dl mZ d dlZd dlZddlmZ dZdd Zdd	 ZdS )
    )absolute_importN   )Optionsae  Cython (http://cython.org) is a compiler for code written in the
Cython language.  Cython is based on Pyrex by Greg Ewing.

Usage: cython [options] sourcefile.{pyx,py} ...

Options:
  -V, --version                  Display version number of cython compiler
  -l, --create-listing           Write error messages to a listing file
  -I, --include-dir <directory>  Search for include files in named directory
                                 (multiple include directories are allowed).
  -o, --output-file <filename>   Specify name of generated C file
  -t, --timestamps               Only compile newer source files
  -f, --force                    Compile all source files (overrides implied -t)
  -v, --verbose                  Be verbose, print file names on multiple compilation
  -p, --embed-positions          If specified, the positions in Cython files of each
                                 function definition is embedded in its docstring.
  --cleanup <level>              Release interned objects on python exit, for memory debugging.
                                 Level indicates aggressiveness, default 0 releases nothing.
  -w, --working <directory>      Sets the working directory for Cython (the directory modules
                                 are searched from)
  --gdb                          Output debug information for cygdb
  --gdb-outdir <directory>       Specify gdb debug information output directory. Implies --gdb.

  -D, --no-docstrings            Strip docstrings from the compiled module.
  -a, --annotate                 Produce a colorized HTML version of the source.
  --annotate-coverage <cov.xml>  Annotate and include coverage information from cov.xml.
  --line-directives              Produce #line directives pointing to the .pyx source
  --cplus                        Output a C++ rather than C file.
  --embed[=<method_name>]        Generate a main() function that embeds the Python interpreter.
  -2                             Compile based on Python-2 syntax and code semantics.
  -3                             Compile based on Python-3 syntax and code semantics.
  --3str                         Compile based on Python-3 syntax and code semantics without
                                 assuming unicode by default for string literals under Python 2.
  --lenient                      Change some compile time errors to runtime errors to
                                 improve Python compatibility
  --capi-reexport-cincludes      Add cincluded headers to any auto-generated header files.
  --fast-fail                    Abort the compilation on the first error
  --warning-errors, -Werror      Make all warnings into errors
  --warning-extra, -Wextra       Enable extra warnings
  -X, --directive <name>=<value>[,<name=value,...] Overrides a compiler directive
  -E, --compile-time-env name=value[,<name=value,...] Provides compile time env like DEF would do.
c                   C   s   t jt t d d S )Nr   )sysstderrwriteusageexit r
   r
   g/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/Cython/Compiler/CmdLine.py	bad_usage>   s    r   c              
      s  ddl m}m} g  fdddA fdd	}fdd}||}g } r, d	 d
r }|dv rxd|_q*|dv rd|_q*|dv rd|_q*|dkr|dt_q*|dr|j	
|| q*|dkr|j	
|  q*|dv r | |_q*|dv r| |_q*|dv r*d|_q*|dv r>d	|_q*|dv rZ| jd7  _q*|dv rndt_q*|dv r| t_q*|dkrt| t_q*|dv rdt_q*|dv rdt_q*|dkrdt_| t_q*|dkrdt_q*|d kr
d|_q*|d!krd|_q*|d"kr:d|_tj|_q*|d#krVd|_| |_q*|d$krpdt_dt_q*|d%krd&|_q*|d'krd(|_q*|d)krd*|_q*|d+krd|_ q*|d,krdt_!q*|d-krdt_"q*|d.v rdt_#q*|d/v r|j$%tj& q*|d0kr,dt_'q*|d1ksB|d2r|d2rn|d&d  ( rn|d&d  }n| }ztj)|d|j$d3|_$W nF t*y }	 z,t+j,-d4|	j.d	   t+/d W Y d }	~	n
d }	~	0 0 q*|d5ks|d6r|d6r|d&d  ( r|d&d  }n| }ztj0||j1d7|_1W nF t*y| }	 z,t+j,-d8|	j.d	   t+/d W Y d }	~	n
d }	~	0 0 n|d9r|d&d  2d
d:}dd;l3m4}
 |t5|
v rt6|
|d nt+j,-d<|  t7  n<|d=v rt+j8-t9 t+/d	 nt+j,-d>|  t+/d qJ|
  qJr8t7  |jrdt:|dkrdt+j,-d? t+/d t:|d	kr|jst7  tjrt:|dkrt+j,-d@ t+/d ||fS )BNr   )CompilationOptionsdefault_optionsc                     sV    rrt   d d v rL d drL ddd\} }| | S  dS )N=r   z--r   )r   
startswithpopsplitappend)namevalueargspending_argr
   r   pop_argH   s    
z#parse_command_line.<locals>.pop_argc                    s,   r  S | d ur| S  s"t    dS )Nr   )r   r   )defaultr   r
   r   	pop_valueQ   s    z%parse_command_line.<locals>.pop_valuec                    s   | dd  }|r|S   S d S )N   r
   )optiontail)r   r
   r   	get_paramZ   s    z%parse_command_line.<locals>.get_paramr   -)z-Vz	--version)z-lz--create-listing)z-+z--cplusz--embedmainz-Iz--include-dir)z-wz	--working)z-oz--output-file)z-tz--timestamps)z-fz--force)z-vz	--verbose)z-pz--embed-positions)z-zz--pre-importz	--cleanup)z-Dz--no-docstringsF)z-az
--annotateTz--annotate-coveragez--convert-rangez--line-directivesz--no-c-in-tracebackz--gdbz--gdb-outdirz	--lenientz-2r   z-3   z--3strZ3strz--capi-reexport-cincludesz--fast-failz--cimport-from-pyx)z-Werrorz--warning-errors)z-Wextraz--warning-extraz--old-style-globalsz--directivez-X)Zrelaxed_boolcurrent_settingsz Error in compiler directive: %s
z--compile-time-envz-E)r#   zError in compile-time-env: %s
z--debug_)
DebugFlagszUnknown debug flag: %s
)z-hz--helpzUnknown compiler flag: %s
z3cython: Only one source file allowed when using -o
z7cython: Only one source file allowed when using -embed
)N);ZMainr   r   r   Zshow_versionZuse_listing_fileZcplusr   embedZinclude_pathr   Zworking_pathZoutput_fileZ
timestampsverboseZembed_pos_in_docstringZ
pre_importintZgenerate_cleanup_codeZ
docstringsZannotateZannotate_coverage_xmlZconvert_rangeZemit_linenumsZc_line_in_tracebackZ	gdb_debugoscurdir
output_dirZerror_on_unknown_namesZerror_on_uninitializedZlanguage_levelZcapi_reexport_cincludesZ	fast_failZcimport_from_pyxZwarning_errorsZcompiler_directivesupdateZextra_warningsZold_style_globalsstripZparse_directive_list
ValueErrorr   r   r   r   r	   Zparse_compile_time_envZcompile_time_envreplace r%   dirsetattrr   stdoutr   len)r   r   r   r   r   optionssourcesr   Zx_argser%   r
   )r   r   r   r   parse_command_lineC   s   		














































$"


r8   )	
__future__r   r)   r   r0   r   r   r   r8   r
   r
   r
   r   <module>   s   3