YBFj dZddlZddlmZmZmZmZmZmZm Z ddl m Z m Z m Z mZmZmZmZmZmZmZddlmZgdZGddeZejd ZGd d eZGd d eZGddeZdS)z pygments.lexers.matlab ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Matlab and related languages. :copyright: Copyright 2006-present by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerbygroupsdefaultwords do_insertionsinclude) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace)_scilab_builtins) MatlabLexerMatlabSessionLexer OctaveLexer ScilabLexercheZdZdZdZdgZdgZdgZdZdZ dZ e e fd e d e j fd e j fd e jfd efdefde fdefdedfdefdefdefg dejfdejdfdefdeeedfdeeeeedfdeeedfed d!d"#eeefegd$d%d"#ejfd&eeefd'e d(eeeed)fed*g d+ejd,fd-ejfdejfgd.eeeeeeejeeee d,fd/eeejd,fgd0eejeeee fd1eejeeeefd2efd3ed,fdefdefgdejdfdefd4ed,fed*gd5ed,fgd6ed,fe e d,fd7efd8efd9efd:ed,fed,gd;Zd<Zd=S)>rz! For Matlab source code. Matlabmatlab*.mz text/matlab.https://www.mathworks.com/products/matlab.html0.10z?-|==|~=|<=|>=|<|>|&&|&|~|\|\|?|\.\*|\*|\+|\.\^|\^|\.\\|\./|/|\\z'(?z+MatlabLexer.analyse_text.. sP"C"C4)+(D)A)A"C$"C"C"C"C"C"Cr5{?rg?z^!\w+)nextrr startswithrsearchM)rfirst_non_comments` r analyse_textzMatlabLexer.analyse_text s "C"C"C"C4??3D3D"C"C"CDFHHHM   ( ( 4 4 0002 Yxrt , , 3 Yxrt , , 3  rN) __name__ __module__ __qualname____doc__namealiases filenames mimetypesurl version_added _operatorsr rFloatIntegerrrrrr Otherr Multilinerr rBuiltinr Functionrtokensrrrrrs DjGII :CMSJ  " ' '''(.  6 ' 6  (+K 8 { #!( + f %  2 d # Z 4L3 <fl # '+^ < g  %xx G'D'Di P . Xj':{ C C & (( Xj' * *J 8 U$ +6 ;;; Xj' * *  ,A(A(A(DP'!IPE(E(E(LP OPH( VPxx99 :GJ F F F Xj$ 3 3] D GM " "_Qp( dQ*F 3 w( ) 7$ % B Xj$ K $-d!://06 8 $ Xj$- 0 0& :  ( XdlJ Z 0 XdlJ Z ;  K ( Z 4L  '+^ < g  gv . GM " "   ' ; ' 6 *  #   & ! +v & GFOO  aS})})F~S     rrz.*? c.eZdZdZdZdgZdZdZdZdZ dS) rzz For Matlab sessions. Modeled after PythonConsoleLexer. Contributed by Ken Schutte . zMatlab session matlabsessionrrz&matlabsession/matlabsession_sample.txtc #Ktd i|j}d}g}d}t|D])}|}|drI|t|dtj |ddfgf||ddz }n|drI|t|dtj |ddfgf||ddz }n)|dr7t|}dtj |f} ||| gfn|r|rt|d d d } |d | zrH|t|dtj |d| fgf||| dz }nX||z }nR|r-t|| |Ed{Vd}g}| tj|fV|d rd }'d}+|r+t|| |Ed{VdSdS)NrFz>> rz>>z??? z...Tr#)roptionsline_refinditergroupr rlenrPrompt Tracebackrget_tokens_unprocessedrOutputrendswith) selfrmlexercurcode insertions continuationrrFidxtoken line_starts rr2z)MatlabSessionLexer.get_tokens_unprocessed s),,t|,,  %%d++. %. %E;;==Du%%$ :!!3w<<%&RaR$A#B#DEEE48#&& :!!3w<<%&RaR$A#B#DEEE48#'' :'llG-t4!!3.1111 :* : B!3B!788 ??3z>22$%%WGND*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(cdS)z?Octave is quite hard to spot, and it looks like Matlab as well.rr#)rs rrzOctaveLexer.analyse_text sqrN)#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 0 0$- @x ( . 9 4h ? 2H = , { #  6 E #V\ 2 V^ $!( +  2 d # TN 4Le3 j*F 3 w( ) 7$ % *F 3 w( ) 7$ %  ' B Xj$ K $-d!://06 8 $ Xj$- 0 0& :  EKKFZrrceZdZdZdZdZdgZgdZdgZdZ de j fd e d fe d d e fe ejejzejzd ejfe ejd ejfdefdefdefdefdefdedfdejfdejfdejfdefdefdefgdedfdedfgdeeeeeeejeeee dfdeeejdfgdZ d Z!d!S)"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 sQ 9Y % %  SLE 9Z & &  SLE5#rN)"rrrrrrrrrrr Singler rr functions_kw commands_kw macros_kwrr  variables_kwr r rrrrrrr rr!r"rr#rrrr s D #CjG+++IIM '  3 UN W\ ]]] U#0#/0#-.6;===>Bl LU#0 ? ? ? O/ 9 2H ="; /  !( +  2 6 E #V\ 2 V^ $ d # Z 4LQ) V ' 66 " B Xj$ K $-d!://06 8 $XXdDM%B%BF K  _77Ft     rr)rrpygments.lexerrrrrrrr pygments.tokenr r r r rrrrrrpygments.lexersr__all__rcompiler,rrrr#rrr s -------------------------,,,,, M M MX*X*X*X*X**X*X*X*vT 2:g  DDDDDDDDDDDDDDDDN^^^^^*^^^B NNNNN*NNNNNr