
    AeC*                     <    d dl mZ d dlZd dlZddlmZ dZd Zd Zy)    )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                  t    t         j                  j                  t               t        j                  d       y )Nr   )sysstderrwriteusageexit     7lib/python3.12/site-packages/Cython/Compiler/CmdLine.py	bad_usager   B   s    JJUHHQKr   c                 x    ddl m}m} g  fddB fd	}fd} ||      }g } r d   j                  d      r        }|dv r	d|_        n|d	v r	d|_        n|d
v r	d|_        n|dk(  r |d      t        _        n|j                  d      r#|j                  j                   ||             nd|dk(  r"|j                  j                   |              n=|dv r |       |_        n+|dv r |       |_        n|dv r	d|_        n|dv r	d|_        n|dv r|xj                  dz  c_        n|dv rdt        _        n|dv r |       t        _        n|dk(  rt#         |             t        _        n|dv rdt        _        n|dv rdt        _        n{|dk(  rdt        _         |       t        _        nY|dk(  rdt        _        nG|dk(  r	d|_        n9|dk(  r	d|_        n+|dk(  rd|_        t4        j6                  |_        n|d k(  rd|_         |       |_        n|d!k(  rdt        _        dt        _        n|d"k(  r	d#|_        n|d$k(  r	d%|_        n|d&k(  r	d'|_        n|d(k(  r	d|_         n|d)k(  rdt        _!        n|d*k(  rdt        _"        nu|d+v rdt        _#        nd|d,v r+|jH                  jK                  t        jL                         n5|d-k(  rdt        _'        n#|d.k(  s|j                  d/      r[|j                  d/      r|d#d  jQ                         r|d#d  }n |       }	 t        jR                  |d|jH                  0      |_$        n|d2k(  s|j                  d3      rZ|j                  d3      r|d#d  jQ                         r|d#d  }n |       }	 t        j`                  ||jb                  4      |_1        nB|d6k(  r |       |_2        n/|d7v r	d|_3        n"|j                  d8      rc|d#d  ji                  dd9      }dd:l5m6}
 |to        |
      v rtq        |
|d       ntV        jX                  j[                  d;|z         ts                n|d<v r9tV        jt                  j[                  tv               tW        j^                  d       nqtV        jX                  j[                  tv               tV        jX                  j[                  d=|z         tW        j^                  d       n|j                                  rr
ts                |j
                  rBty        |      dkD  r4tV        jX                  j[                  d>       tW        j^                  d       ty        |      dk(  r|j                  s
ts                t        j                  rBty        |      dkD  r4tV        jX                  j[                  d?       tW        j^                  d       |jd                  r|j                  r4tV        jX                  j[                  d@       tW        j^                  d       ty        |      dkD  r4tV        jX                  j[                  dA       tW        j^                  d       ||fS # tT        $ rO}	tV        jX                  j[                  d1|	j\                  d   z         tW        j^                  d       Y d }	~	d }	~	ww xY w# tT        $ rO}	tV        jX                  j[                  d5|	j\                  d   z         tW        j^                  d       Y d }	~	d }	~	ww xY w)CNr   )CompilationOptionsdefault_optionsc                      rr
t                dd   v rKd   j                  d      r7j                  d      j                  dd      \  } }j	                  |       | S j                  d      S )N=r   z--r   )r   
startswithpopsplitappend)namevalueargspending_args     r   pop_argz#parse_command_line.<locals>.pop_argK   sh    {K$q'>d1g006((1+++C3KD%u%Kxx{r   c                 j    rj                         S | | S s
t                j                  d      S )Nr   )r   r   )defaultr   r   s    r   	pop_valuez%parse_command_line.<locals>.pop_valueT   s4    ??$$ NKxx{r   c                 $    | dd  }|r|S         S )N   r   )optiontailr   s     r   	get_paramz%parse_command_line.<locals>.get_param]   s    abzK9r   r   -)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--3str3strz--capi-reexport-cincludesz--fast-failz--cimport-from-pyx)z-Werrorz--warning-errors)z-Wextraz--warning-extraz--old-style-globalsz--directivez-X)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)=Mainr   r   r   show_versionuse_listing_filecplusr   embedinclude_pathr   working_pathoutput_file
timestampsverboseembed_pos_in_docstring
pre_importintgenerate_cleanup_code
docstringsannotateannotate_coverage_xmlconvert_rangeemit_linenumsc_line_in_traceback	gdb_debugoscurdir
output_direrror_on_unknown_nameserror_on_uninitializedlanguage_levelcapi_reexport_cincludes	fast_failcimport_from_pyxwarning_errorscompiler_directivesupdateextra_warningsold_style_globalsstripparse_directive_list
ValueErrorr   r   r	   r   r   parse_compile_time_envcompile_time_envmodule_namedepfilereplace r-   dirsetattrr   stdoutr
   len)r   r   r   r    r%   optionssourcesr#   x_argser-   r   r   s   `          @@r   parse_command_linerb   F   s   9K !1GG
7c"YF,,'($55+,(,, !9$ )& 1""4($$++If,=>?*$$++IK8..'0{$22&/k#11%&",,%&"..1$6612.11%.[";&03IK0@-44%*"//#' 00#' 09-,,(,%..(,%00.3+7"$(!%'YY">)$(!%.[";&16.16.4)*&4)*&8#)/&6626/=($(!//+/(::)-&99++2273I3IJ00,0)=(F,=,=d,C$$T*vabz/?/?/A#ABZF&[F 292N2NT)0)D)D3FG/ //63D3DT3J$$T*vabz/?/?/A#ABZF&[F /6/M/M1I1I0KG,
 ?*&/k#.."&""9-++C5(S_,J5JJ$$%?&%HIK++

  '

  '

  !>!GHNN79%e h CL1$4

B	D
7|q!5!5}}W)

G	IJJFHHHQKw<!JJQSHHQKGu "  JJ$$%H166RS9%TUHHQKK  "  JJ$$%FPQ%RSHHQKK s2   'Z 6&[! 	[A[[!	\9*A\44\9)	
__future__r   rC   r   rY   r   r
   r   rb   r   r   r   <module>rd      s&   
 ' 	 
 .	njr   