o
    xiq                     @   s   d Z ddlZddlmZmZmZ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mZ ddlmZ g dZG dd deZed	ZG d
d deZG dd deZG dd deZdS )z
    pygments.lexers.matlab
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Matlab and related languages.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)Lexer
RegexLexerbygroupswordsdo_insertions)
TextCommentOperatorKeywordNameStringNumberPunctuationGeneric
Whitespace)_scilab_builtins)MatlabLexerMatlabSessionLexerOctaveLexerScilabLexerc                   @   s6  e Zd ZdZdZdgZdgZdgZdZdZ	dZ
d	ejfd
ejdfdefdedfedddefddee	 e
  d ejfdefdefdefdefdefdefdejfdejfdejfdedfd efd!efgd"ed#fgd$ejd#fd%ejfd!ejfgd&eeeeeeejeeee
d#fd'eeejd#fgd(Zd)d* Zd+S ),r   z=
    For Matlab source code.

    .. versionadded:: 0.10
    Matlabmatlab*.mztext/matlab)Csinsindsinhasinasindasinhcoscosdcoshacosacosdacoshtantandtanhatanatandatan2atanhsecsecdsechasecasecdasechcsccscdcschacscacscdacschcotcotdcothacotacotdacothhypotexpexpm1loglog1plog10log2pow2realpowreallogrealsqrtsqrtnthrootnextpow2absanglecomplexconjimagrealunwrapisrealcplxpairfixfloorceilroundmodremsign)'airybesseljbesselybesselhbesselibesselkbetabetaincbetalnellipjellipkeerferfcerfcxerfinvexpintgammagammaincgammalnpsilegendrecrossdotfactorisprimeprimesgcdlcmratratspermsnchoosek	factorialcart2sphcart2polpol2cartsph2carthsv2rgbrgb2hsv)Czerosoneseyerepmatrandrandnlinspacelogspace	freqspacemeshgrid
accumarraysizelengthndimsnumeldispisemptyisequalisequalwithequalnanscatreshapediagblkdiagtriltriufliplrflipudflipdimrot90findendsub2indind2subbsxfunndgridpermuteipermuteshiftdim	circshiftsqueezeisscalarisvectoransepsrealmaxrealminpiiinfnanisnanisinfisfinitejwhycompangalleryhadamardhankelhilbinvhilbmagicpascalrossertoeplitzvander	wilkinsonz^!.*z%\{\s*\nblockcommentz%.*$^\s*functiondeffunc)breakcasecatchclassdefcontinueelseelseifr   
enumeratedeventsforfunctionglobalifmethods	otherwiseparfor
persistent
propertiesreturnspmdswitchtrywhile\bsuffix(|z)\bz	\.\.\..*$-|==|~=|<|>|<=|>=|&&|&|~|\|\|?\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\z\[|\]|\(|\)|\{|\}|:|@|\.|,=|:|;(?<=[\w)\].])\'+&(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?\d+[eEf][+-]?[0-9]+\d+(?<![\w)\].])\'string[a-zA-Z_]\w*.z[^\']*\'#popz^\s*%\}z^.*\n0(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)(\s*)([a-zA-Z_]\w*))rootr   r   r   c                 C   s,   t d| t jr
dS t d| t jrdS d S )Nz^\s*%g?z^!\w+)rematchM)text r   W/home/ubuntu/.local/lib/python3.10/site-packages/wandb/vendor/pygments/lexers/matlab.pyanalyse_text   s
   zMatlabLexer.analyse_textN)__name__
__module____qualname____doc__namealiases	filenames	mimetypeselfunspecfunelmatr   Otherr   	Multiliner
   r   joinr   Builtinr	   r   r   FloatIntegerr   r   r   Functiontokensr   r   r   r   r   r      sb    
+


=r   z.*?
c                   @   s"   e Zd ZdZdZdgZdd ZdS )r   z
    For Matlab sessions.  Modeled after PythonConsoleLexer.
    Contributed by Ken Schutte <kschutte@csail.mit.edu>.

    .. versionadded:: 0.10
    zMatlab sessionmatlabsessionc           
   	   c   sD   t di | j}d}g }t|D ]{}| }|dr8|t|dtj	|d d fgf ||dd  7 }q|drX|t|dtj	|d d fgf ||dd  7 }q|drpt|}dtj
|f}|||gf q|rt|||D ]}	|	V  qzd}g }| tj|fV  q|rt|||D ]}	|	V  qd S d S )	N z>> r      z>>   z???r   )r   optionsline_refinditergroup
startswithappendlenr   Prompt	Tracebackr   get_tokens_unprocessedstartOutput)
selfr   mlexercurcode
insertionsr   lineidxtokenitemr   r   r   r     sF   






z)MatlabSessionLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r  r   r   r   r   r      s
    r   c                   @   s*  e Zd ZdZdZdgZdgZdgZdZdZ	dZ
d	Zd
ZdZdefdedfedddefeee	 e
 e e ddejfeeddejfdefdefdefdefdefdefdefdejfdejfdejfdefdedfdefd efgd!ed"fgd#eeeeeeejeeee
d"fd$eeejd"fgd%Zd&S )'r   z@
    For GNU Octave source code.

    .. versionadded:: 1.5
    Octaveoctaver   ztext/octave(=  addlisteneraddpathaddpropertyallandanyargnamesargvassigninatexitautoloadavailable_graphics_toolkitsbeep_on_errorbitandbitmaxbitorbitshiftbitxorr   cellcellstrcharclassclccolumnscommand_line_pathcompletion_append_charcompletion_matchesrN   confirm_recursive_rmdircputimecrash_dumps_octave_core
ctransposecumprodcumsumdebug_on_errordebug_on_interruptdebug_on_warningdefault_save_optionsdellistenerr   diffr   doc_cache_filedo_string_escapesdoubledrawnoweecho_executing_commandsr   eqerrno
errno_listerrorevalevalinexecexistexitr   falsefclearfclosefcntlfdispfeofferrorfevalfflushfgetlfgets
fieldnamesfile_in_loadpathfile_in_path
filemarkerfilesepfind_dir_in_pathfixed_point_formatfnmatchfopenforkformulafprintffputsfreadfreportfrewindfscanffseekfskiplftell	functionsfwritegegenpathgetgetegidgetenvgeteuidgetgidgetpgrpgetpidgetppidgetuidglobgtgui_modehistory_controlhistory_filehistory_sizehistory_timestamp_format_stringhomehorzcatr>   ifelseignore_function_time_stamp
inferiorto	info_fileinfo_programinlineinputintmaxintminr   is_absolute_filenameisargoutisbooliscell	iscellstrischar	iscomplexr   isfieldisfloatisglobalishandleisieeeisindex	isinteger	islogicalismatrixismethodisnull	isnumericisobjectrS   is_rooted_relative_filenameissortedisstruct	isvarnamekbhitkeyboardkilllasterr	lasterrorlastwarnldivideler   linkr   logicallstatltmake_absolute_filenamemakeinfo_programmax_recursion_depthmerger   	mfilenameminus	mislockedmkdirmkfifomkstempmldividemlockmouse_wheel_zoommpowermrdividemtimesmunlocknarginnargoutnative_float_formatr   nenfieldsnnznormnotr   nzmaxoctave_config_infooctave_core_file_limitoctave_core_file_nameoctave_core_file_optionsr   oroutput_max_field_widthoutput_precisionpage_output_immediatelypage_screen_outputpathpathseppausepcloser   r   pipepluspopenpowerprint_empty_dimensionsprintfprint_struct_array_contentsprodprogram_invocation_nameprogram_nameputenvputspwdquitry   rdividereaddirreadlinkread_readline_init_filer   r   rehashrenamerepelemsre_read_readline_init_fileresetr   resizerestoredefaultpathrethrowrmdirrmfieldrmpathrowssave_header_format_stringsave_precisionsaving_historyscanfsetsetenv	shell_cmdsighup_dumps_octave_coresigterm_dumps_octave_coresilent_functionssingler   
size_equalsizemaxsizeofsleepsourcesparse_auto_mutatesplit_long_rowssprintfr   sscanfstatstderrstdinstdoutstrcmpstrcmpistring_fill_charstrncmpstrncmpistructstruct_levels_to_printstrvcatsubsasgnsubsrefsumsumsq
superiortosuppress_verbose_help_messagesymlinksystemtictilde_expandtimestmpfiletmpnamtoctoupper	transposetruetypeinfoumaskuminusunameundo_string_escapesunlinkuplusupperusageusleepvec	vectorizevertcatwaitpidwarningwarrantywhos_line_format	yes_or_nor   r   Infr   NaN)closeloadwhowhos(h  r   accumdimr#   r<   r6   	addtodateallchildancestoranovaarch_fitarch_rnd	arch_testareaarma_rndarrayfunasciiasctimer0   r   assertr)   autoreg_matrixautumnaxesaxisbarbarhbartlettbartlett_testbeepbetacdfbetainvbetapdfbetarndbicgstabbicubicbinarybinocdfbinoinvbinopdfbinorndbitcmpbitgetbitsetblackmanblanksr   boneboxbrightencalendarcast
cauchy_cdf
cauchy_inv
cauchy_pdf
cauchy_rndcaxiscelldispcentercgschisquare_test_homogeneitychisquare_test_independencer   claclabelclfclockcloglogclosereqcoloncolorbarcolormapcolpermcometcommon_sizecommutation_matrixr   compare_versionscompasscomputercondcondestcontourcontourccontourfcontrastconvconvhullcoolcoppercopyfilecorcorrcoefcor_testr    r9   covrT   rq   r3   cstrcatcsvreadcsvwritectimecumtrapzcurlcutcylinderdatedatenumdatestrdatetickdatevecdblquaddealdeblankdeconvdelaunay	delaunayndeletedemodetrenddiffparadiffusedirdiscrete_cdfdiscrete_invdiscrete_pdfdiscrete_rnddisplay
divergencedlmwritedosdsearchdsearchnduplication_matrixdurbinlevinson	ellipsoidempirical_cdfempirical_invempirical_pdfempirical_rndeomdayerrorbaretime	etreeplotexampleexpcdfexpinvexpmexppdfexprnd	ezcontour
ezcontourfezmeshezmeshcezplotezpolarezsurfezsurfcrs   r|   failfcdffeatherfftconvfftfiltfftshiftfigure
fileattrib	filepartsfillfindallfindobjfindstrfinvflagr   r   r   fpdffplot	fractdifffreqz
freqz_plotfrndfsolvef_test_regressionftpfullfilefzerogamcdfgaminvgampdfgamrndgcagcbfgcbogcf
genvarnamegeocdfgeoinvgeopdfgeorndgetfieldginputglpkglsgplotgradientgraphics_toolkitgraygridgriddata	griddatangtextgunzipgzipr   hammingr   hanninghggrouphiddenr   histhistcholdhothotelling_testhoushhsvhursthygecdfhygeinvhygepdfhygerndidivide	ifftshiftimageimagescimfinfoimreadimshowimwriteindexinfo	inpolygon	inputnameinterpftinterpn	intersectr   iqrisa
isdefiniteisdiris_duplicate_entryr   r   isfigureishermitian
ishghandleis_leap_yearisletterismacismemberispcrt   ispropr   issquare	isstrpropissymmetricisunixis_valid_file_idr   jetkendallkolmogorov_smirnov_cdfkolmogorov_smirnov_testkruskal_wallis_testkrylovkurtosislaplace_cdflaplace_invlaplace_pdflaplace_rndlegendrp   licenser"  linkproplist_primes	loadaudioloadobjlogistic_cdflogistic_invlogistic_pdflogistic_rndlogitloglog	loglogerrlogmlogncdflogninvlognpdflognrndr   lookfor
ls_command	lsqnonnegr   mahalanobismanova
matlabrootmcnemar_testmeanmeansqmedianmenumeshmeshcr   meshzmexextmgetmkppmodemomentmovefilempolesmputnamelengthmaxnargchk
nargoutchknbincdfnbininvnbinpdfnbinrndr{   r   newplotnewsnonzerosnormcdfnormestnorminvnormpdfnormrndnowrJ   nulloceanols
onenormestoptimgetoptimsetorderfieldsorientorthpackparetoparseparamsr   patchpathdefpcgpchippcolorpcrpeaksperiodogramperlrz   piepinkplanerot	playaudioplot
plotmatrixplotyypoisscdfpoissinvpoisspdfpoissrndpolarpoly
polyaffinepolyarea	polyderivpolyfitpolygcdpolyintpolyout
polyreducepolyvalpolyvalmpostpadpowersetppderppintppjumpsppplotppval	pqpnonnegprepadru   printprint_usageprismprobitqpqqplotquadccquadgkquadlquadvquiverqzhessrainbowrandirangerankranksrx   rG   rF   rH   recordrectangle_lwrectangle_swrectintrefreshrefreshdataregexptranslater   residueribbonrindexrootsroser   rotdimrrefrun	run_countrundemosrun_testruntestssaveas	saveaudiosaveobjsavepathscatterr-   semilogxsemilogxerrsemilogysemilogyerrsetaudiosetdiffsetfieldsetxorshadingshiftr   	sign_testsincr   sinetonesinewaveskewnessslicesombrerosortrows	spaugment	spconvertspdiagsspearmanspectral_adfspectral_xdfspecularspeedspencerspeyespfunspherespinmapsplinesponessprandsprandn	sprandsymspringspstatsspysqpstairs
statisticsstdstdnormal_cdfstdnormal_invstdnormal_pdfstdnormal_rndstemstftstrcatstrchrstrjuststrmatchstrreadstrsplitstrtokstrtrimstrtrunc	structfun
studentizesubplot	subsindexsubspacesubstr	substructsummersurfsurfacesurfcsurflsurfnormsvds	swapbytessylvester_matrixsymvar	synthesistabler&   tartcdftempdirtempnametestr   textreadtextscantinvtitler   tpdftracetrapz
treelayouttreeplottriangle_lwtriangle_swr   trimesh
triplequadtriplottrisurfr   trndtsearchnt_testt_test_regressiontypeunidcdfunidinvunidpdfunidrndunifcdfunifinvunifpdfunifrndunionuniqueunixunmkppunpackuntabifyuntarrR   unzipu_testvalidatestringr   varvar_testvechverversionviewvoronoivoronoinwaitforbuttonpresswavreadwavwritewblcdfwblinvwblpdfwblrndweekday
welch_testwhatwhitewhitebgwienrndwilcoxon_testr   winterxlabelxlimylabel
yulewalkerzipzlabelz_test)r\   amdbalancer_   r`   r]   ra   r^   bitpackr   builtinccolamdcellfun
cellsliceschol
choldelete
cholinsertcholinv	cholshift
cholupdatecolamdcolloc	convhullnconvncsymamdcummaxcummindaspkdaspk_optionsdasrtdasrt_optionsdassldassl_optionsdbcleardbdowndbstackdbstatusdbstopdbtypedbupdbwheredetdlmreaddmpermrr   eigeigsendgrentendpwentetreefftfftnfftwfilterr   fullrv   getgrentgetgrgidgetgrnamgetpwentgetpwnamgetpwuid	getrusagegivensgmtimegnuplot_binaryhessifftifftninvisdebugmodeissparsekron	localtimelookuplsodelsode_optionsluluincluupdatematrix_typemaxminmktimepinvqrqrdeleteqrinsertqrshiftqrupdatequadquad_optionsqzr   randerandgr   randprandpermrcondregexpregexpi	regexprepschursetgrentsetpwentsortspallocsparsespparmsspranksqrtmstrfindstrftimestrptimestrrepsvd
svd_driversylsymamdsymbfactsymrcmtimetsearchtypecasturlreadurlwrite)MrL   r"   r$   r;   r=   r5   r7   rM   argr/   r1   r   r   r(   r+   rb   rc   rd   bincoeffcbrtrW   rO   r   r!   r8   r:   r2   r4   rg   rh   ri   rj   r?   finiterU   rV   fmodrl   rm   rn   rP   isalnumisalphaisasciiiscntrlisdigitr   isgraphr   islowerisnar   isprintispunctisspaceisupperisxdigitrw   lgammarA   lowerrY   rQ   rZ   rX   roundbr,   r.   r[   r   r   rI   r%   r'   toasciitolowerxor)EDITOR	EXEC_PATHI
IMAGE_PATHNAOCTAVE_HOMEOCTAVE_VERSIONPAGERPAGER_FLAGSSEEK_CURSEEK_ENDSEEK_SETSIGS_ISBLKS_ISCHRS_ISDIRS_ISFIFOS_ISLNKS_ISREGS_ISSOCK	WCONTINUE	WCOREDUMPWEXITSTATUSWIFCONTINUED	WIFEXITEDWIFSIGNALED
WIFSTOPPEDWNOHANGWSTOPSIGWTERMSIG	WUNTRACEDz[%#].*$r   r   )__FILE____LINE__r   r   r   r   r   dor   r   r   end_try_catchend_unwind_protectendclassdef	endeventsendforendfunctionendif
endmethodsendproperties	endswitchendwhiler   r   r   r  r   r   r   r   r   r   r   r	  staticr   r   untilunwind_protectunwind_protect_cleanupr   r   r   z-=|!=|!|/=|--r   z$\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*r   z[\[\](){}:@.,]r   "[^"]*"r   r   r   r   r   r   r   r   [^']*'r   r   r   r   r   r   N)r   r   r   r   r   r   r  r  
builtin_kw
command_kwfunction_kwloadable_kw
mapping_kwbuiltin_constsr   r
   r   r   r	  Constantr	   r   r   r   r
  r  r   r   r   r  r  r   r   r   r   r      sj    Z 	1


r   c                   @   s  e Zd ZdZdZdgZg dZdgZdej	fde
dfed	d
de
feejej ej d
dejfeejd
dejfdefdefdefdefdefdedfdejfdejfdejfdefdefgdedfdedfgdeeeeeeejeeee
dfdeeejdfgdZdS )r   z<
    For Scilab source code.

    .. versionadded:: 1.5
    Scilabscilab)z*.sciz*.scez*.tstztext/scilabz//.*?$r   r   r(  r   r   r   r   z[\[\](){}@.,=:;]r;  r   r   r   r   r   r   r   r   r<  r   r   r   r=  N)r   r   r   r   r   r   r  r  r   Singler
   r   r   functions_kwcommands_kw	macros_kwr   r	  variables_kwrD  r	   r   r   r   r
  r  r   r   r   r  r  r   r   r   r   r   V  s`    	*


r   )r   r   pygments.lexerr   r   r   r   r   pygments.tokenr   r   r	   r
   r   r   r   r   r   r   pygments.lexersr   __all__r   compiler  r   r   r   r   r   r   r   <module>   s   
0
x6   