o a7@sdZddlZddlmZmZmZmZmZmZm Z ddl m Z m Z m Z mZmZmZmZmZmZmZddlmZgdZGdddeZed ZGd d d eZGd d d eZGdddeZdS)z pygments.lexers.matlab ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Matlab and related languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerbygroupsdefaultwords do_insertionsinclude) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace)_scilab_builtins) MatlabLexerMatlabSessionLexer OctaveLexer ScilabLexerc@seZdZdZdZdgZdgZdgZdZee fdee j fde j fd e j fd e fd e fd e fd efdedfdefdefdefg dejfdejdfdefdeeedfdeeeee dfdeeedfedddd eeefegd!d"dd ejfd#eeefd$eeeeed%fed&g d'ejd(fd)ejfdejfgd*eeeee eeje ee e d(fd+eeejd(fgd,eejee ee fd-eejee eefd.e fd/e d(fdefdefgdejdfdefd0ed(fed&gd1ed(fgd2e d(fee d(fd3efd4efd5efd6e d(fed(gd7Zd8d9Zd:S);rz= For Matlab source code. .. versionadded:: 0.10 Matlabmatlab*.mz text/matlabz<-|==|~=|<=|>=|<|>|&&|&|~|\|\|?|\.\*|\*|\+|\.\^|\.\\|\./|/|\\zB(? s z+MatlabLexer.analyse_text..r1{g?rg?z^!\w+)nextrr startswithrsearchM)rfirst_non_commentrrr analyse_text s zMatlabLexer.analyse_textN)__name__ __module__ __qualname____doc__namealiases filenames mimetypes _operatorsr rFloatIntegerrrr rr Otherr Multilinerr rBuiltinrFunctionrtokensr rrrrrs4       F       rz.*? c@s"eZdZdZdZdgZddZdS)rz For Matlab sessions. Modeled after PythonConsoleLexer. Contributed by Ken Schutte . .. versionadded:: 0.10 zMatlab session matlabsessionc cstd i|j}d}g}d}t|D]}|}|dr:|t|dtj |ddfgf||dd7}n|drZ|t|dtj |ddfgf||dd7}ne|drrt|}dtj |f} ||| gfnM|rt|d d d } |d | r|t|dtj |d| fgf||| d7}n||7}n|rt || |EdHd}g}| tj|fV|d rd }qd}q|rt || |EdHdSdS)NrFz>> rz>>z??? z...Tr)roptionsline_refinditergrouprrlenrPrompt Tracebackrget_tokens_unprocessedrOutputrendswith) selfrmlexercurcode insertions continuationrrBidxtoken line_startrrrr' sX          z)MatlabSessionLexer.get_tokens_unprocessedN)r r r rrrr'rrrrr s  rc@seZdZdZdZdgZdgZdgZdZdZ dZ d Z d Z d Z d ejd fdejdfdefdedfedddefeee e e e ddejfee ddejfdefdefdefdefdefdefdefdejfdejfdejfd efd!ed"fd#efd$efd%efgd&ejd'fd(ejfd%ejfgd)ejd'fd(ejfd%ejfgd*ed'fgd+eeeeeeejeeee d'fd,eeejd'fgd-Zd.d/Z d0S)1rz@ For GNU Octave source code. .. versionadded:: 1.5 Octaveoctaverz text/octave(=rr addpropertyrandrargnamesargvratexitautoloadavailable_graphics_toolkits beep_on_errorrbitmaxrrrr5r@rGrKrWrYcolumnscommand_line_pathcompletion_append_charcompletion_matchesr}confirm_recursive_rmdirrcrash_dumps_octave_corerrrdebug_on_errordebug_on_interruptdebug_on_warningdefault_save_options dellistenerrrr doc_cache_filedo_string_escapesrreecho_executing_commandsr2r3errno errno_listr<rBrDexecrHrIrXr]fclearr^fcntlfdisprbrcrdfflushrkrlrmfile_in_loadpath file_in_pathrtrwfind_dir_in_pathfixed_point_formatfnmatchrforkformularfputsrfreportrrrfskiplrrrgerrgetegidrgeteuidgetgidgetpgrpgetpidgetppidgetuidglobgtgui_modehistory_control history_file history_sizehistory_timestamp_format_stringrUrVr]ifelseignore_function_time_stamp inferiorto info_file info_programinlinerrrris_absolute_filenameisargoutisboolrrr iscomplexrrrisglobalrisieeeisindexrrrrisnullrrris_rooted_relative_filenamerr rkbhitr'killlasterr lasterrorr.ldivideler5linkrIrXlstatltmake_absolute_filenamemakeinfo_programmax_recursion_depthmerger4rminusrrmkfifomkstemprrmouse_wheel_zoomrrrrrrnative_float_formatrnenfieldsrrnotrr octave_config_infooctave_core_file_limitoctave_core_file_nameoctave_core_file_optionsroroutput_max_field_widthoutput_precisionpage_output_immediatelypage_screen_outputr?r@rCpcloserOrPpiper^popenpowerprint_empty_dimensionsprintfprint_struct_array_contentsrprogram_invocation_name program_nameputenvputsrrrrdividereaddirreadlinkread_readline_init_filerrrrrepelemsre_read_readline_init_filerrresizerrrrr rowssave_header_format_stringsave_precisionsaving_historyscanfr=rK shell_cmdsighup_dumps_octave_coresigterm_dumps_octave_coresilent_functionsrfri size_equalsizemaxsizeofsleepsourcesparse_auto_mutatesplit_long_rowsrrrstatstderrstdinstdoutrrstring_fill_charrrrstruct_levels_to_printstrvcatrrrsumsq superiortosuppress_verbose_help_messagesymlinkrr  tilde_expandtimestmpfiletmpnamrtoupperr!r,typeinfoumaskrjunameundo_string_escapesunlinkr~rusageusleepvec vectorizerwaitpidrwarrantywhos_line_format yes_or_norinfrNnanrV)rirOrr(hroaccumdimrqrtrwrrranovaarch_fitarch_rnd arch_testrarma_rndrrasctimerrrrautoreg_matrixrrrrrbartlett bartlett_testrbetacdfbetainvbetapdfbetarndrbicubicrbinocdfbinoinvbinopdfbinorndrrrblackmanrrrrrrr4 cauchy_cdf cauchy_inv cauchy_pdf cauchy_rndr8rDcenterrJchisquare_test_homogeneitychisquare_test_independencerSrUrVr`rgcloglogrkrrrsrurwry common_sizecommutation_matrixr{compare_versionsr|rrrrrrrrrrrrcorrcor_testrrrrrrcstrcatcsvreadcsvwritectimerrcutrrrrrrdblquaddealrrrrrrrdiffpararr  discrete_cdf discrete_inv discrete_pdf discrete_rndrrdlmwriterdsearchrduplication_matrixdurbinlevinsonr) empirical_cdf empirical_inv empirical_pdf empirical_rndr1r=r?rAexampleexpcdfexpinvrMexppdfexprnd ezcontour ezcontourfezmeshezmeshcezplotrYezsurfezsurfcr[r\failfcdfr`fftconvfftfiltrirnrsrurxrrfindstrfinvrflipdimrrfpdfr fractdifffreqz freqz_plotfrndfsolvef_test_regressionrrrgamcdfgaminvgampdfgamrndrrrr genvarnamegeocdfgeoinvgeopdfgeorndrrglpkglsr r graphics_toolkitrrrrrrrr&hammingr(hanningrIrKrMhisthistcrSrWhotelling_testhoushr[hursthygecdfhygeinvhygepdfhygerndrarerlrnrprurwryindexinforrrrrrrr isdefiniteisdiris_duplicate_entryrisequalwithequalnansisfigurer ishghandle is_leap_yearrrrrrrrissquarer r ris_valid_file_idrr"kendallkolmogorov_smirnov_cdfkolmogorov_smirnov_testkruskal_wallis_testkrylovkurtosis laplace_cdf laplace_inv laplace_pdf laplace_rndr3r4r=rBrG list_primes loadaudiorR logistic_cdf logistic_inv logistic_pdf logistic_rndlogitrY loglogerrrZlogncdflogninvlognpdflognrndr[r^ ls_commandrcrf mahalanobismanovart mcnemar_testrxmeansqrymenurrrrrrrrmomentrmpolesrrnargchkrnbincdfnbininvnbinpdfnbinrndrrrnewsrnormcdfrnorminvnormpdfnormrndrrroceanols onenormestrr r#r&r'r-r6 parseparamsr=r>pathdefrErFrHpcrrK periodogramrMrNrQrSrU playaudiorXr\plotyypoisscdfpoissinvpoisspdfpoissrndpolarrf polyaffinerg polyderivrkpolygcdrlpolyout polyreducernropostpadpowersetppderppintppjumpsppplotrs pqpnonnegprepadryrz print_usager~probitqpqqplotquadccrquadlquadvrqzhessrainbowrrangerranksrrrrr rectangle_lw rectangle_swrrrrrrrrindexrroserrotdimrr" run_countrundemosrun_testr%r( saveaudior*r+r-r4r8 semilogxerrr9 semilogyerrsetaudiorJrLrWrYshiftr\ sign_testsincresinetonesinewaveskewnessrjsombrerorqrxryrzspearman spectral_adf spectral_xdfr{speedspencerr|r}rrrrrrrrspstatsrsqpr statisticsr stdnormal_cdf stdnormal_inv stdnormal_pdf stdnormal_rndrstftrstrchrrstrmatchstrreadrrrstrtruncr studentizerrrsubstrrrrrrrrrrsylvester_matrixsymvar synthesisrrrtcdfrrtestrtextreadrtinvrrtpdfrr#r$r% triangle_lw triangle_swr'r( triplequadr)r*r+trndr.t_testt_test_regressionr1unidcdfunidinvunidpdfunidrndunifcdfunifinvunifpdfunifrndrnrorqrtunpackuntabifyryrzr{u_testrrrvar_testvechrrrrrrwavreadwavwritewblcdfwblinvwblpdfwblrndr welch_testrwhitewhitebgwienrnd wilcoxon_testrrrrr yulewalkerrrz_test)rrrrrrrrbitpackr rccolamdrE cellslicesrO choldelete cholinsertcholinv cholshiftrPrpcollocrrcsymamdrrdaspk daspk_optionsdasrt dasrt_optionsdassl dassl_optionsrrrrrrrdbwhererdlmreadrrr%r&endgrentendpwentr@rfrhrjr|rrrgetgrentgetgrgidgetgrnamgetpwentgetpwnamgetpwuid getrusagegivensgmtimegnuplot_binaryrErbrdr isdebugmoderr) localtimelookuplsode lsode_optionsreluincluupdate matrix_typerurmktimerTrrrqrshiftrquad quad_optionsrrranderandgrrandprrrrrr1setgrentsetpwentrnrvrwrrrrstrftimestrptimerr svd_driversylrrrr tsearchr2urlreadurlwrite)Mrnrprrrsrurvrxrargrrrrrrrrrbincoeffcbrtr?rrrrrrrr7r8r:r;rJfiniterrfmodrrrrkisalnumisalphaisasciiiscntrlisdigitrisgraphrislowerisnarisprintispunctrisupperisxdigitr0lgammarTr_rrrrroundbr3r5rbrdrgrrrtoasciitolowerr)EDITOR EXEC_PATHI IMAGE_PATHNA OCTAVE_HOMEOCTAVE_VERSIONPAGER PAGER_FLAGSSEEK_CURSEEK_ENDSEEK_SETSIGS_ISBLKS_ISCHRS_ISDIRS_ISFIFOS_ISLNKS_ISREGS_ISSOCK WCONTINUE WCOREDUMP WEXITSTATUS WIFCONTINUED WIFEXITED WIFSIGNALED WIFSTOPPEDWNOHANGWSTOPSIGWTERMSIG WUNTRACEDr"percentblockcommentz#\{\s*\nhashblockcommentz[%#].*$^\s*function\br$)__FILE____LINE__r'r(r)r*r+dor-r.r/ end_try_catchend_unwind_protect endclassdef endeventsendfor endfunctionendif endmethods endproperties endswitchendwhilerFr0r1rr2r3r4r5r7rr8r=staticr:r;untilunwind_protectunwind_protect_cleanupr<\br>z -=|!=|!|/=|---|==|~=|<|>|<=|>=|&&|&|~|\|\|?z$\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\z[\[\](){}:@.,]r"[^"]*"&(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?\d+[eEf][+-]?[0-9]+\d+rrrrr r!rrrz^\s*#\}rrr)rrP rQ rr$cCsdS)z?Octave is quite hard to spot, and it looks like Matlab as well.rrrrrrr  szOctaveLexer.analyse_textN)!r r r rrrrr builtin_kw command_kw function_kw loadable_kw mapping_kwbuiltin_constsr rr rr rConstantr rrrrrr rrrrr rrrrr sZ    5     Mrc@seZdZdZdZdgZgdZdgZdej fde dfe d d d e fe e j e je jd d ejfe e jd d ejfd efd efdefdefdefdedfdejfdejfdejfdefdefdefgdedfdedfgdeeeeeeejeeee dfdeeejdfgdZdS)rz< For Scilab source code. .. versionadded:: 1.5 Scilabscilab)z*.sciz*.scez*.tstz text/scilabz//.*?$rR r$rS rf rg rh ri z[\[\](){}@.,=:;]+rj rrrrk rl rm rr r!rrrr)rrr$N)r r r rrrrrr Singler rr functions_kw commands_kw macros_kwr r variables_kwrt r rrrrrrr rrrrrrrr sb +   r)rrpygments.lexerrrrrrrrpygments.tokenr r r r r rrrrrpygments.lexersr__all__rcompiler!rrrrrrrsF $0  0F$