B
    dC*                 @   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   )Optionsa  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.
  --module-name                  Fully qualified module name. If not given, it is deduced from the
                                 import path if source file is in a package, or equals the
                                 filename otherwise.
  -M, --depfile                  Produce depfiles for the sources
c               C   s   t jt t d d S )Nr   )sysstderrwriteusageexit r
   r
   d/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/Cython/Compiler/CmdLine.py	bad_usageB   s    r   c          
      s2  ddl m}m} g  fdddE fdd	}fdd}||}g }x r^ d	 d
rP }|dkr|d|_q\|dkrd|_q\|dkrd|_q\|dkr|dt_q\|dr|j	
|| q\|dkr|j	
|  q\|dkr| |_q\|dkr| |_q\|dkr.d|_q\|dkrBd	|_q\|dkr^| jd7  _q\|dkrrdt_q\|dkr| t_q\|dkrt| t_q\|dkrdt_q\|dk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rZd|_| |_q\|d$krtd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.kr dt_#q\|d/kr|j$%tj& q\|d0kr0dt_'q\|d1ksF|d2r|d2rr|d&d  ( rr|d&d  }n| }ytj)|d|j$d3|_$W nD t*k
r }	 z$t+j,-d4|	j.d	   t+/d W d d }	~	X Y nX q\|d5ks|d6r|d6r|d&d  ( r|d&d  }n| }ytj0||j1d7|_1W nD t*k
r| }	 z$t+j,-d8|	j.d	   t+/d W d d }	~	X Y nX n|d9kr| |_2n|d:krd|_3n|d;r|d&d  4d
d<}dd=l5m6}
 |t7|
krt8|
|d nt+j,-d>|  t9  nH|d?kr(t+j:-t; t+/d	 n&t+j,-t; t+j,-d@|  t+/d qN|
  qNW rlt9  |jrt<|dkrt+j,-dA t+/d t<|d	kr|jst9  tjrt<|dkrt+j,-dB t+/d |j2r*|jrt+j,-dC t+/d t<|dkr*t+j,-dD t+/d ||fS )FNr   )CompilationOptionsdefault_optionsc                 sV    rrt   d d k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_argK   s    
z#parse_command_line.<locals>.pop_argc                s,   r  S | d k	r| S  s"t    dS )Nr   )r   r   )default)r   r   r
   r   	pop_valueT   s    z%parse_command_line.<locals>.pop_valuec                s   | dd  }|r|S   S d S )N   r
   )optiontail)r   r
   r   	get_param]   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--module-name)z-Mz	--depfilez--debug_)
DebugFlagszUnknown debug flag: %s
)z-hz--helpzUnknown compiler flag: %s
z3cython: Only one source file allowed when using -o
z8cython: Only one source file allowed when using --embed
z3cython: Cannot use --module-name with --timestamps
z>cython: Only one source file allowed when using --module-name
)N)=ZMainr   r   r   Zshow_versionZuse_listing_fileZcplusr   Z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module_nameZdepfilereplace r$   dirsetattrr   stdoutr   len)r   r   r   r   r   optionssourcesr   Zx_argser$   r
   )r   r   r   r   parse_command_lineF   s   		















































 







r7   )	
__future__r   r'   r   r/   r   r   r   r7   r
   r
   r
   r   <module>   s   0	