K idZddlZddlmZmZmZmZmZmZm Z ddl m Z m Z m Z mZmZmZmZmZmZmZddlmZgdZGddeZej2d ZGd d eZGd d eZGddeZy)z pygments.lexers.matlab ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Matlab and related languages. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerbygroupsdefaultwords do_insertionsinclude) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace)_scilab_builtins) MatlabLexerMatlabSessionLexer OctaveLexer ScilabLexerceZdZdZdZdgZdgZdgZdZdZ dZ e e fd e d e jfd e jfd e jfd efdefde fdefdedfdefdefdefg dej(fdej,dfdefdeeedfdeeeeedfdeeedfed d!d"#eeefegd$d%d"#ej4fd&eeefd'e d(eeeed)fed*g d+ej,d,fd-ej,fdej,fgd.eeeeeeej8eeee d,fd/eeej8d,fgd0eej4eeee fd1eej4eeeefd2efd3ed,fdefdefgdej,dfdefd4ed,fed*gd5ed,fgd6ed,fe e d,fd7efd8efd9efd:ed,fed,gd;Zd<Zy=)>rz! For Matlab source code. Matlabmatlab*.mz text/matlab.https://www.mathworks.com/products/matlab.html0.10z?-|==|~=|<=|>=|<|>|&&|&|~|\|\|?|\.\*|\*|\+|\.\^|\^|\.\\|\./|/|\\z'(?z+MatlabLexer.analyse_text.. s("C4)+(D)A#'"Cs"%r5{?rg?z^!\w+)nextrr startswithrsearchM)rfirst_non_comments` r analyse_textzMatlabLexer.analyse_text s} "C4??3D"CDFHHM   ( ( 400 YYxrtt , YYxrtt ,-N) __name__ __module__ __qualname____doc__namealiases filenames mimetypesurl version_added _operatorsr rFloatIntegerrrrrr Otherr Multilinerr rBuiltinr FunctionrtokensrrrrrsG DjGII :CMSJ  " 8 |D''(.  6 ' 6  (+K 8 { #!( + f %  2 d # Z 4L3 <fll # '++^ < g  %x G'Di P . j':{ C & (( j' *J 8 $ +6 ; j' *  ,A(DP'!IPE(LP OPH( VPx9 :4J. zMatlab session matlabsessionrrz&matlabsession/matlabsession_sample.txtc #^Ktd i|j}d}g}d}tj|D]}|j }|j dr;|j t|dtj|ddfgf||ddz }nG|j dr:|j t|dtj|ddfgf||ddz }n|j dr3t|}dtj|f} |j || gfn|rj|rht|d d d } |j d | zr:|j t|dtj|d| fgf||| dz }nR||z }nL|r't||j|Ed{d}g}|jtj|f|jj!d rd }d}|r$t||j|Ed{yy7z7w)NrFz>> rz>>z??? z...Tr#)roptionsline_refinditergroupr rlenrPrompt Tracebackrget_tokens_unprocessedrOutputrendswith) selfrmlexercurcode insertions continuationrrFidxtoken line_starts rr2z)MatlabSessionLexer.get_tokens_unprocessed sD,t||,  %%d+. %E;;=Du%!!3w<%&Ra$A#B#DE48#&!!3w<%&Ra$A#B#DE48#''lG--t4!!3.1* B!3B!78 ??3z>2%%WGNND*r?rNfiniterrfmodrrrroisalnumisalphaisasciiiscntrlisdigitrisgraphrislowerisnarisprintispunctr isupperisxdigitr4lgammarXrcrrrrroundbr7r9rfrhrkrrrtoasciitolowerr)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/dor1r2r3 end_try_catchend_unwind_protect endclassdef endeventsendfor endfunctionendif endmethods endproperties endswitchendwhilerJr4r5rr6r7r8r9r;rr<rAstaticr>r?untilunwind_protectunwind_protect_cleanupr@\brBz -=|!=|!|/=|---|==|~=|<|>|<=|>=|&&|&|~|\|\|?z$\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*"\.\*|\*|\+|\.\^|\^|\.\\|\.\/|\/|\\z[\[\](){}:@.,]r"[^"]*"&(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?\d+[eEf][+-]?[0-9]+\d+r r!r"r#r$r%rrrz^\s*#\}rrr)rr^ r_ r"r(cy)z?Octave is quite hard to spot, and it looks like Matlab as well.rr#)rs rrzOctaveLexer.analyse_text srN)#rrrrrrrrrr builtin_kw command_kw function_kw loadable_kw mapping_kwbuiltin_constsr rr rrr Constantr rrrrrr rrr!r"rr#rrrr s[ D 5CjGIIM4X$Jt2JUKn+K>% 0$-- @x ( . 9 4h ? 2H = , { #  6 E #V\\ 2 V^^ $!( +  2 d # TN 4Le3 j**F 3 w(( ) 7$$ % **F 3 w(( ) 7$$ %  ' B j$ K $--d!:/06 8 $ j$-- 0& :  EKFZrrc$eZdZdZdZdZdgZgdZdgZdZ de jfd e d fe d d e fe ejej zej"zd ej&fe ej(d ej*fdefdefdefdefdefdedfdej4fdej4fdej6fdefdefdefgdedfdedfgdeeeeeeej>eeee dfdeeej>dfgdZ d Z!y!)"rz! For Scilab source code. Scilabzhttps://www.scilab.org/scilab)z*.sciz*.scez*.tstz text/scilabrAz//.*?$r` r(ra rt ru rv rw z[\[\](){}@.,=:;]+rx r r!r"ry rz r{ r#r$r%rrrr)rr"r(cd}tjd|r|dz }tjd|r|dz }t|dS)Ngz^\s*//g?z^\s*/\*r )rr r)rscores rrzScilabLexer.analyse_text sC 99Y % SLE 99Z & SLE5#rN)"rrrrrrrrrrr Singler rr functions_kw commands_kw macros_kwrr  variables_kwr r rrrrrrr rr!r"rr#rrrr s D #CjG+IIM '  3 N W\ ] #00#//0#--.6;=>Bll L#00 ? O/ 9 2H ="; /  !( +  2 6 E #V\\ 2 V^^ $ d # Z 4LQ) V ' 66 " B j$ K $--d!:/06 8 $XdDMM%BF K  _7Ft rr)rrpygments.lexerrrrrrrr pygments.tokenr r r r rrrrrrpygments.lexersr__all__rcompiler,rrrr#rrr s ---- MX**X*vT 2::g DDDDN^*^B N*Nr