123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306 |
- """
- pygments.lexers.matlab
- ~~~~~~~~~~~~~~~~~~~~~~
- Lexers for Matlab and related languages.
- :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
- :license: BSD, see LICENSE for details.
- """
- import re
- from pygments.lexer import Lexer, RegexLexer, bygroups, default, words, \
- do_insertions, include
- from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Generic, Whitespace
- from pygments.lexers import _scilab_builtins
- __all__ = ['MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer']
- class MatlabLexer(RegexLexer):
- """
- For Matlab source code.
- """
- name = 'Matlab'
- aliases = ['matlab']
- filenames = ['*.m']
- mimetypes = ['text/matlab']
- url = 'https://www.mathworks.com/products/matlab.html'
- version_added = '0.10'
- _operators = r'-|==|~=|<=|>=|<|>|&&|&|~|\|\|?|\.\*|\*|\+|\.\^|\.\\|\./|/|\\'
- tokens = {
- 'expressions': [
- # operators:
- (_operators, Operator),
- # numbers (must come before punctuation to handle `.5`; cannot use
- # `\b` due to e.g. `5. + .5`). The negative lookahead on operators
- # avoids including the dot in `1./x` (the dot is part of `./`).
- (rf'(?<!\w)((\d+\.\d+)|(\d*\.\d+)|(\d+\.(?!{_operators})))'
- r'([eEf][+-]?\d+)?(?!\w)', Number.Float),
- (r'\b\d+[eEf][+-]?[0-9]+\b', Number.Float),
- (r'\b\d+\b', Number.Integer),
- # punctuation:
- (r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation),
- (r'=|:|;', Punctuation),
- # quote can be transpose, instead of string:
- # (not great, but handles common cases...)
- (r'(?<=[\w)\].])\'+', Operator),
- (r'"(""|[^"])*"', String),
- (r'(?<![\w)\].])\'', String, 'string'),
- (r'[a-zA-Z_]\w*', Name),
- (r'\s+', Whitespace),
- (r'.', Text),
- ],
- 'root': [
- # line starting with '!' is sent as a system command. not sure what
- # label to use...
- (r'^!.*', String.Other),
- (r'%\{\s*\n', Comment.Multiline, 'blockcomment'),
- (r'%.*$', Comment),
- (r'(\s*^\s*)(function)\b', bygroups(Whitespace, Keyword), 'deffunc'),
- (r'(\s*^\s*)(properties)(\s+)(\()',
- bygroups(Whitespace, Keyword, Whitespace, Punctuation),
- ('defprops', 'propattrs')),
- (r'(\s*^\s*)(properties)\b',
- bygroups(Whitespace, Keyword), 'defprops'),
- # from 'iskeyword' on version 9.4 (R2018a):
- # Check that there is no preceding dot, as keywords are valid field
- # names.
- (words(('break', 'case', 'catch', 'classdef', 'continue',
- 'dynamicprops', 'else', 'elseif', 'end', 'for', 'function',
- 'global', 'if', 'methods', 'otherwise', 'parfor',
- 'persistent', 'return', 'spmd', 'switch',
- 'try', 'while'),
- prefix=r'(?<!\.)(\s*)(', suffix=r')\b'),
- bygroups(Whitespace, Keyword)),
- (
- words(
- [
- # See https://mathworks.com/help/matlab/referencelist.html
- # Below data from 2021-02-10T18:24:08Z
- # for Matlab release R2020b
- "BeginInvoke",
- "COM",
- "Combine",
- "CombinedDatastore",
- "EndInvoke",
- "Execute",
- "FactoryGroup",
- "FactorySetting",
- "Feval",
- "FunctionTestCase",
- "GetCharArray",
- "GetFullMatrix",
- "GetVariable",
- "GetWorkspaceData",
- "GraphPlot",
- "H5.close",
- "H5.garbage_collect",
- "H5.get_libversion",
- "H5.open",
- "H5.set_free_list_limits",
- "H5A.close",
- "H5A.create",
- "H5A.delete",
- "H5A.get_info",
- "H5A.get_name",
- "H5A.get_space",
- "H5A.get_type",
- "H5A.iterate",
- "H5A.open",
- "H5A.open_by_idx",
- "H5A.open_by_name",
- "H5A.read",
- "H5A.write",
- "H5D.close",
- "H5D.create",
- "H5D.get_access_plist",
- "H5D.get_create_plist",
- "H5D.get_offset",
- "H5D.get_space",
- "H5D.get_space_status",
- "H5D.get_storage_size",
- "H5D.get_type",
- "H5D.open",
- "H5D.read",
- "H5D.set_extent",
- "H5D.vlen_get_buf_size",
- "H5D.write",
- "H5DS.attach_scale",
- "H5DS.detach_scale",
- "H5DS.get_label",
- "H5DS.get_num_scales",
- "H5DS.get_scale_name",
- "H5DS.is_scale",
- "H5DS.iterate_scales",
- "H5DS.set_label",
- "H5DS.set_scale",
- "H5E.clear",
- "H5E.get_major",
- "H5E.get_minor",
- "H5E.walk",
- "H5F.close",
- "H5F.create",
- "H5F.flush",
- "H5F.get_access_plist",
- "H5F.get_create_plist",
- "H5F.get_filesize",
- "H5F.get_freespace",
- "H5F.get_info",
- "H5F.get_mdc_config",
- "H5F.get_mdc_hit_rate",
- "H5F.get_mdc_size",
- "H5F.get_name",
- "H5F.get_obj_count",
- "H5F.get_obj_ids",
- "H5F.is_hdf5",
- "H5F.mount",
- "H5F.open",
- "H5F.reopen",
- "H5F.set_mdc_config",
- "H5F.unmount",
- "H5G.close",
- "H5G.create",
- "H5G.get_info",
- "H5G.open",
- "H5I.dec_ref",
- "H5I.get_file_id",
- "H5I.get_name",
- "H5I.get_ref",
- "H5I.get_type",
- "H5I.inc_ref",
- "H5I.is_valid",
- "H5L.copy",
- "H5L.create_external",
- "H5L.create_hard",
- "H5L.create_soft",
- "H5L.delete",
- "H5L.exists",
- "H5L.get_info",
- "H5L.get_name_by_idx",
- "H5L.get_val",
- "H5L.iterate",
- "H5L.iterate_by_name",
- "H5L.move",
- "H5L.visit",
- "H5L.visit_by_name",
- "H5ML.compare_values",
- "H5ML.get_constant_names",
- "H5ML.get_constant_value",
- "H5ML.get_function_names",
- "H5ML.get_mem_datatype",
- "H5O.close",
- "H5O.copy",
- "H5O.get_comment",
- "H5O.get_comment_by_name",
- "H5O.get_info",
- "H5O.link",
- "H5O.open",
- "H5O.open_by_idx",
- "H5O.set_comment",
- "H5O.set_comment_by_name",
- "H5O.visit",
- "H5O.visit_by_name",
- "H5P.all_filters_avail",
- "H5P.close",
- "H5P.close_class",
- "H5P.copy",
- "H5P.create",
- "H5P.equal",
- "H5P.exist",
- "H5P.fill_value_defined",
- "H5P.get",
- "H5P.get_alignment",
- "H5P.get_alloc_time",
- "H5P.get_attr_creation_order",
- "H5P.get_attr_phase_change",
- "H5P.get_btree_ratios",
- "H5P.get_char_encoding",
- "H5P.get_chunk",
- "H5P.get_chunk_cache",
- "H5P.get_class",
- "H5P.get_class_name",
- "H5P.get_class_parent",
- "H5P.get_copy_object",
- "H5P.get_create_intermediate_group",
- "H5P.get_driver",
- "H5P.get_edc_check",
- "H5P.get_external",
- "H5P.get_external_count",
- "H5P.get_family_offset",
- "H5P.get_fapl_core",
- "H5P.get_fapl_family",
- "H5P.get_fapl_multi",
- "H5P.get_fclose_degree",
- "H5P.get_fill_time",
- "H5P.get_fill_value",
- "H5P.get_filter",
- "H5P.get_filter_by_id",
- "H5P.get_gc_references",
- "H5P.get_hyper_vector_size",
- "H5P.get_istore_k",
- "H5P.get_layout",
- "H5P.get_libver_bounds",
- "H5P.get_link_creation_order",
- "H5P.get_link_phase_change",
- "H5P.get_mdc_config",
- "H5P.get_meta_block_size",
- "H5P.get_multi_type",
- "H5P.get_nfilters",
- "H5P.get_nprops",
- "H5P.get_sieve_buf_size",
- "H5P.get_size",
- "H5P.get_sizes",
- "H5P.get_small_data_block_size",
- "H5P.get_sym_k",
- "H5P.get_userblock",
- "H5P.get_version",
- "H5P.isa_class",
- "H5P.iterate",
- "H5P.modify_filter",
- "H5P.remove_filter",
- "H5P.set",
- "H5P.set_alignment",
- "H5P.set_alloc_time",
- "H5P.set_attr_creation_order",
- "H5P.set_attr_phase_change",
- "H5P.set_btree_ratios",
- "H5P.set_char_encoding",
- "H5P.set_chunk",
- "H5P.set_chunk_cache",
- "H5P.set_copy_object",
- "H5P.set_create_intermediate_group",
- "H5P.set_deflate",
- "H5P.set_edc_check",
- "H5P.set_external",
- "H5P.set_family_offset",
- "H5P.set_fapl_core",
- "H5P.set_fapl_family",
- "H5P.set_fapl_log",
- "H5P.set_fapl_multi",
- "H5P.set_fapl_sec2",
- "H5P.set_fapl_split",
- "H5P.set_fapl_stdio",
- "H5P.set_fclose_degree",
- "H5P.set_fill_time",
- "H5P.set_fill_value",
- "H5P.set_filter",
- "H5P.set_fletcher32",
- "H5P.set_gc_references",
- "H5P.set_hyper_vector_size",
- "H5P.set_istore_k",
- "H5P.set_layout",
- "H5P.set_libver_bounds",
- "H5P.set_link_creation_order",
- "H5P.set_link_phase_change",
- "H5P.set_mdc_config",
- "H5P.set_meta_block_size",
- "H5P.set_multi_type",
- "H5P.set_nbit",
- "H5P.set_scaleoffset",
- "H5P.set_shuffle",
- "H5P.set_sieve_buf_size",
- "H5P.set_sizes",
- "H5P.set_small_data_block_size",
- "H5P.set_sym_k",
- "H5P.set_userblock",
- "H5R.create",
- "H5R.dereference",
- "H5R.get_name",
- "H5R.get_obj_type",
- "H5R.get_region",
- "H5S.close",
- "H5S.copy",
- "H5S.create",
- "H5S.create_simple",
- "H5S.extent_copy",
- "H5S.get_select_bounds",
- "H5S.get_select_elem_npoints",
- "H5S.get_select_elem_pointlist",
- "H5S.get_select_hyper_blocklist",
- "H5S.get_select_hyper_nblocks",
- "H5S.get_select_npoints",
- "H5S.get_select_type",
- "H5S.get_simple_extent_dims",
- "H5S.get_simple_extent_ndims",
- "H5S.get_simple_extent_npoints",
- "H5S.get_simple_extent_type",
- "H5S.is_simple",
- "H5S.offset_simple",
- "H5S.select_all",
- "H5S.select_elements",
- "H5S.select_hyperslab",
- "H5S.select_none",
- "H5S.select_valid",
- "H5S.set_extent_none",
- "H5S.set_extent_simple",
- "H5T.array_create",
- "H5T.close",
- "H5T.commit",
- "H5T.committed",
- "H5T.copy",
- "H5T.create",
- "H5T.detect_class",
- "H5T.enum_create",
- "H5T.enum_insert",
- "H5T.enum_nameof",
- "H5T.enum_valueof",
- "H5T.equal",
- "H5T.get_array_dims",
- "H5T.get_array_ndims",
- "H5T.get_class",
- "H5T.get_create_plist",
- "H5T.get_cset",
- "H5T.get_ebias",
- "H5T.get_fields",
- "H5T.get_inpad",
- "H5T.get_member_class",
- "H5T.get_member_index",
- "H5T.get_member_name",
- "H5T.get_member_offset",
- "H5T.get_member_type",
- "H5T.get_member_value",
- "H5T.get_native_type",
- "H5T.get_nmembers",
- "H5T.get_norm",
- "H5T.get_offset",
- "H5T.get_order",
- "H5T.get_pad",
- "H5T.get_precision",
- "H5T.get_sign",
- "H5T.get_size",
- "H5T.get_strpad",
- "H5T.get_super",
- "H5T.get_tag",
- "H5T.insert",
- "H5T.is_variable_str",
- "H5T.lock",
- "H5T.open",
- "H5T.pack",
- "H5T.set_cset",
- "H5T.set_ebias",
- "H5T.set_fields",
- "H5T.set_inpad",
- "H5T.set_norm",
- "H5T.set_offset",
- "H5T.set_order",
- "H5T.set_pad",
- "H5T.set_precision",
- "H5T.set_sign",
- "H5T.set_size",
- "H5T.set_strpad",
- "H5T.set_tag",
- "H5T.vlen_create",
- "H5Z.filter_avail",
- "H5Z.get_filter_info",
- "Inf",
- "KeyValueDatastore",
- "KeyValueStore",
- "MException",
- "MException.last",
- "MaximizeCommandWindow",
- "MemoizedFunction",
- "MinimizeCommandWindow",
- "NET",
- "NET.Assembly",
- "NET.GenericClass",
- "NET.NetException",
- "NET.addAssembly",
- "NET.convertArray",
- "NET.createArray",
- "NET.createGeneric",
- "NET.disableAutoRelease",
- "NET.enableAutoRelease",
- "NET.invokeGenericMethod",
- "NET.isNETSupported",
- "NET.setStaticProperty",
- "NaN",
- "NaT",
- "OperationResult",
- "PutCharArray",
- "PutFullMatrix",
- "PutWorkspaceData",
- "PythonEnvironment",
- "Quit",
- "RandStream",
- "ReleaseCompatibilityException",
- "ReleaseCompatibilityResults",
- "Remove",
- "RemoveAll",
- "Setting",
- "SettingsGroup",
- "TallDatastore",
- "Test",
- "TestResult",
- "Tiff",
- "TransformedDatastore",
- "ValueIterator",
- "VersionResults",
- "VideoReader",
- "VideoWriter",
- "abs",
- "accumarray",
- "acos",
- "acosd",
- "acosh",
- "acot",
- "acotd",
- "acoth",
- "acsc",
- "acscd",
- "acsch",
- "actxGetRunningServer",
- "actxserver",
- "add",
- "addCause",
- "addCorrection",
- "addFile",
- "addFolderIncludingChildFiles",
- "addGroup",
- "addLabel",
- "addPath",
- "addReference",
- "addSetting",
- "addShortcut",
- "addShutdownFile",
- "addStartupFile",
- "addStyle",
- "addToolbarExplorationButtons",
- "addboundary",
- "addcats",
- "addedge",
- "addevent",
- "addlistener",
- "addmulti",
- "addnode",
- "addpath",
- "addpoints",
- "addpref",
- "addprop",
- "addsample",
- "addsampletocollection",
- "addtodate",
- "addts",
- "addvars",
- "adjacency",
- "airy",
- "align",
- "alim",
- "all",
- "allchild",
- "alpha",
- "alphaShape",
- "alphaSpectrum",
- "alphaTriangulation",
- "alphamap",
- "alphanumericBoundary",
- "alphanumericsPattern",
- "amd",
- "analyzeCodeCompatibility",
- "ancestor",
- "angle",
- "animatedline",
- "annotation",
- "ans",
- "any",
- "appdesigner",
- "append",
- "area",
- "arguments",
- "array2table",
- "array2timetable",
- "arrayDatastore",
- "arrayfun",
- "asFewOfPattern",
- "asManyOfPattern",
- "ascii",
- "asec",
- "asecd",
- "asech",
- "asin",
- "asind",
- "asinh",
- "assert",
- "assignin",
- "atan",
- "atan2",
- "atan2d",
- "atand",
- "atanh",
- "audiodevinfo",
- "audiodevreset",
- "audioinfo",
- "audioplayer",
- "audioread",
- "audiorecorder",
- "audiowrite",
- "autumn",
- "axes",
- "axis",
- "axtoolbar",
- "axtoolbarbtn",
- "balance",
- "bandwidth",
- "bar",
- "bar3",
- "bar3h",
- "barh",
- "barycentricToCartesian",
- "base2dec",
- "batchStartupOptionUsed",
- "bctree",
- "beep",
- "bench",
- "besselh",
- "besseli",
- "besselj",
- "besselk",
- "bessely",
- "beta",
- "betainc",
- "betaincinv",
- "betaln",
- "between",
- "bfsearch",
- "bicg",
- "bicgstab",
- "bicgstabl",
- "biconncomp",
- "bin2dec",
- "binary",
- "binscatter",
- "bitand",
- "bitcmp",
- "bitget",
- "bitnot",
- "bitor",
- "bitset",
- "bitshift",
- "bitxor",
- "blanks",
- "ble",
- "blelist",
- "blkdiag",
- "bluetooth",
- "bluetoothlist",
- "bone",
- "boundary",
- "boundaryFacets",
- "boundaryshape",
- "boundingbox",
- "bounds",
- "box",
- "boxchart",
- "brighten",
- "brush",
- "bsxfun",
- "bubblechart",
- "bubblechart3",
- "bubblelegend",
- "bubblelim",
- "bubblesize",
- "builddocsearchdb",
- "builtin",
- "bvp4c",
- "bvp5c",
- "bvpget",
- "bvpinit",
- "bvpset",
- "bvpxtend",
- "caldays",
- "caldiff",
- "calendar",
- "calendarDuration",
- "calllib",
- "calmonths",
- "calquarters",
- "calweeks",
- "calyears",
- "camdolly",
- "cameratoolbar",
- "camlight",
- "camlookat",
- "camorbit",
- "campan",
- "campos",
- "camproj",
- "camroll",
- "camtarget",
- "camup",
- "camva",
- "camzoom",
- "canUseGPU",
- "canUseParallelPool",
- "cart2pol",
- "cart2sph",
- "cartesianToBarycentric",
- "caseInsensitivePattern",
- "caseSensitivePattern",
- "cast",
- "cat",
- "categorical",
- "categories",
- "caxis",
- "cd",
- "cdf2rdf",
- "cdfepoch",
- "cdfinfo",
- "cdflib",
- "cdfread",
- "ceil",
- "cell",
- "cell2mat",
- "cell2struct",
- "cell2table",
- "celldisp",
- "cellfun",
- "cellplot",
- "cellstr",
- "centrality",
- "centroid",
- "cgs",
- "char",
- "characterListPattern",
- "characteristic",
- "checkcode",
- "chol",
- "cholupdate",
- "choose",
- "chooseContextMenu",
- "circshift",
- "circumcenter",
- "cla",
- "clabel",
- "class",
- "classUnderlying",
- "clc",
- "clear",
- "clearAllMemoizedCaches",
- "clearPersonalValue",
- "clearTemporaryValue",
- "clearpoints",
- "clearvars",
- "clf",
- "clibArray",
- "clibConvertArray",
- "clibIsNull",
- "clibIsReadOnly",
- "clibRelease",
- "clibgen.buildInterface",
- "clibgen.generateLibraryDefinition",
- "clipboard",
- "clock",
- "clone",
- "close",
- "closeFile",
- "closereq",
- "cmap2gray",
- "cmpermute",
- "cmunique",
- "codeCompatibilityReport",
- "colamd",
- "collapse",
- "colon",
- "colorbar",
- "colorcube",
- "colormap",
- "colororder",
- "colperm",
- "com.mathworks.engine.MatlabEngine",
- "com.mathworks.matlab.types.CellStr",
- "com.mathworks.matlab.types.Complex",
- "com.mathworks.matlab.types.HandleObject",
- "com.mathworks.matlab.types.Struct",
- "combine",
- "comet",
- "comet3",
- "compan",
- "compass",
- "complex",
- "compose",
- "computer",
- "comserver",
- "cond",
- "condeig",
- "condensation",
- "condest",
- "coneplot",
- "configureCallback",
- "configureTerminator",
- "conj",
- "conncomp",
- "containers.Map",
- "contains",
- "containsrange",
- "contour",
- "contour3",
- "contourc",
- "contourf",
- "contourslice",
- "contrast",
- "conv",
- "conv2",
- "convertCharsToStrings",
- "convertContainedStringsToChars",
- "convertStringsToChars",
- "convertTo",
- "convertvars",
- "convexHull",
- "convhull",
- "convhulln",
- "convn",
- "cool",
- "copper",
- "copyHDU",
- "copyfile",
- "copygraphics",
- "copyobj",
- "corrcoef",
- "cos",
- "cosd",
- "cosh",
- "cospi",
- "cot",
- "cotd",
- "coth",
- "count",
- "countcats",
- "cov",
- "cplxpair",
- "cputime",
- "createCategory",
- "createFile",
- "createImg",
- "createLabel",
- "createTbl",
- "criticalAlpha",
- "cross",
- "csc",
- "cscd",
- "csch",
- "ctranspose",
- "cummax",
- "cummin",
- "cumprod",
- "cumsum",
- "cumtrapz",
- "curl",
- "currentProject",
- "cylinder",
- "daspect",
- "dataTipInteraction",
- "dataTipTextRow",
- "datacursormode",
- "datastore",
- "datatip",
- "date",
- "datenum",
- "dateshift",
- "datestr",
- "datetick",
- "datetime",
- "datevec",
- "day",
- "days",
- "dbclear",
- "dbcont",
- "dbdown",
- "dbmex",
- "dbquit",
- "dbstack",
- "dbstatus",
- "dbstep",
- "dbstop",
- "dbtype",
- "dbup",
- "dde23",
- "ddeget",
- "ddensd",
- "ddesd",
- "ddeset",
- "deblank",
- "dec2base",
- "dec2bin",
- "dec2hex",
- "decic",
- "decomposition",
- "deconv",
- "deg2rad",
- "degree",
- "del2",
- "delaunay",
- "delaunayTriangulation",
- "delaunayn",
- "delete",
- "deleteCol",
- "deleteFile",
- "deleteHDU",
- "deleteKey",
- "deleteRecord",
- "deleteRows",
- "delevent",
- "delimitedTextImportOptions",
- "delsample",
- "delsamplefromcollection",
- "demo",
- "descriptor",
- "det",
- "details",
- "detectImportOptions",
- "detrend",
- "deval",
- "dfsearch",
- "diag",
- "dialog",
- "diary",
- "diff",
- "diffuse",
- "digitBoundary",
- "digitsPattern",
- "digraph",
- "dir",
- "disableDefaultInteractivity",
- "discretize",
- "disp",
- "display",
- "dissect",
- "distances",
- "dither",
- "divergence",
- "dmperm",
- "doc",
- "docsearch",
- "dos",
- "dot",
- "double",
- "drag",
- "dragrect",
- "drawnow",
- "dsearchn",
- "duration",
- "dynamicprops",
- "echo",
- "echodemo",
- "echotcpip",
- "edgeAttachments",
- "edgecount",
- "edges",
- "edit",
- "eig",
- "eigs",
- "ellipj",
- "ellipke",
- "ellipsoid",
- "empty",
- "enableDefaultInteractivity",
- "enableLegacyExplorationModes",
- "enableNETfromNetworkDrive",
- "enableservice",
- "endsWith",
- "enumeration",
- "eomday",
- "eps",
- "eq",
- "equilibrate",
- "erase",
- "eraseBetween",
- "erf",
- "erfc",
- "erfcinv",
- "erfcx",
- "erfinv",
- "error",
- "errorbar",
- "errordlg",
- "etime",
- "etree",
- "etreeplot",
- "eval",
- "evalc",
- "evalin",
- "event.ClassInstanceEvent",
- "event.DynamicPropertyEvent",
- "event.EventData",
- "event.PropertyEvent",
- "event.hasListener",
- "event.listener",
- "event.proplistener",
- "eventlisteners",
- "events",
- "exceltime",
- "exist",
- "exit",
- "exp",
- "expand",
- "expint",
- "expm",
- "expm1",
- "export",
- "export2wsdlg",
- "exportapp",
- "exportgraphics",
- "exportsetupdlg",
- "extract",
- "extractAfter",
- "extractBefore",
- "extractBetween",
- "eye",
- "ezpolar",
- "faceNormal",
- "factor",
- "factorial",
- "false",
- "fclose",
- "fcontour",
- "feather",
- "featureEdges",
- "feof",
- "ferror",
- "feval",
- "fewerbins",
- "fft",
- "fft2",
- "fftn",
- "fftshift",
- "fftw",
- "fgetl",
- "fgets",
- "fieldnames",
- "figure",
- "figurepalette",
- "fileDatastore",
- "fileMode",
- "fileName",
- "fileattrib",
- "filemarker",
- "fileparts",
- "fileread",
- "filesep",
- "fill",
- "fill3",
- "fillmissing",
- "filloutliers",
- "filter",
- "filter2",
- "fimplicit",
- "fimplicit3",
- "find",
- "findCategory",
- "findEvent",
- "findFile",
- "findLabel",
- "findall",
- "findedge",
- "findfigs",
- "findgroups",
- "findnode",
- "findobj",
- "findprop",
- "finish",
- "fitsdisp",
- "fitsinfo",
- "fitsread",
- "fitswrite",
- "fix",
- "fixedWidthImportOptions",
- "flag",
- "flintmax",
- "flip",
- "flipedge",
- "fliplr",
- "flipud",
- "floor",
- "flow",
- "flush",
- "fmesh",
- "fminbnd",
- "fminsearch",
- "fopen",
- "format",
- "fplot",
- "fplot3",
- "fprintf",
- "frame2im",
- "fread",
- "freeBoundary",
- "freqspace",
- "frewind",
- "fscanf",
- "fseek",
- "fsurf",
- "ftell",
- "ftp",
- "full",
- "fullfile",
- "func2str",
- "function_handle",
- "functions",
- "functiontests",
- "funm",
- "fwrite",
- "fzero",
- "gallery",
- "gamma",
- "gammainc",
- "gammaincinv",
- "gammaln",
- "gather",
- "gca",
- "gcbf",
- "gcbo",
- "gcd",
- "gcf",
- "gcmr",
- "gco",
- "genpath",
- "geoaxes",
- "geobasemap",
- "geobubble",
- "geodensityplot",
- "geolimits",
- "geoplot",
- "geoscatter",
- "geotickformat",
- "get",
- "getAColParms",
- "getAxes",
- "getBColParms",
- "getColName",
- "getColType",
- "getColorbar",
- "getConstantValue",
- "getEqColType",
- "getFileFormats",
- "getHDUnum",
- "getHDUtype",
- "getHdrSpace",
- "getImgSize",
- "getImgType",
- "getLayout",
- "getLegend",
- "getMockHistory",
- "getNumCols",
- "getNumHDUs",
- "getNumInputs",
- "getNumInputsImpl",
- "getNumOutputs",
- "getNumOutputsImpl",
- "getNumRows",
- "getOpenFiles",
- "getProfiles",
- "getPropertyGroupsImpl",
- "getReport",
- "getTimeStr",
- "getVersion",
- "getabstime",
- "getappdata",
- "getaudiodata",
- "getdatasamples",
- "getdatasamplesize",
- "getenv",
- "getfield",
- "getframe",
- "getinterpmethod",
- "getnext",
- "getpinstatus",
- "getpixelposition",
- "getplayer",
- "getpoints",
- "getpref",
- "getqualitydesc",
- "getrangefromclass",
- "getsamples",
- "getsampleusingtime",
- "gettimeseriesnames",
- "gettsafteratevent",
- "gettsafterevent",
- "gettsatevent",
- "gettsbeforeatevent",
- "gettsbeforeevent",
- "gettsbetweenevents",
- "getvaropts",
- "ginput",
- "gmres",
- "gobjects",
- "gplot",
- "grabcode",
- "gradient",
- "graph",
- "gray",
- "grid",
- "griddata",
- "griddatan",
- "griddedInterpolant",
- "groot",
- "groupcounts",
- "groupfilter",
- "groupsummary",
- "grouptransform",
- "gsvd",
- "gtext",
- "guidata",
- "guide",
- "guihandles",
- "gunzip",
- "gzip",
- "h5create",
- "h5disp",
- "h5info",
- "h5read",
- "h5readatt",
- "h5write",
- "h5writeatt",
- "hadamard",
- "handle",
- "hankel",
- "hasFactoryValue",
- "hasFrame",
- "hasGroup",
- "hasPersonalValue",
- "hasSetting",
- "hasTemporaryValue",
- "hasdata",
- "hasnext",
- "hdfan",
- "hdfdf24",
- "hdfdfr8",
- "hdfh",
- "hdfhd",
- "hdfhe",
- "hdfhx",
- "hdfinfo",
- "hdfml",
- "hdfpt",
- "hdfread",
- "hdfv",
- "hdfvf",
- "hdfvh",
- "hdfvs",
- "head",
- "heatmap",
- "height",
- "help",
- "helpdlg",
- "hess",
- "hex2dec",
- "hex2num",
- "hgexport",
- "hggroup",
- "hgtransform",
- "hidden",
- "highlight",
- "hilb",
- "histcounts",
- "histcounts2",
- "histogram",
- "histogram2",
- "hms",
- "hold",
- "holes",
- "home",
- "horzcat",
- "hot",
- "hour",
- "hours",
- "hover",
- "hsv",
- "hsv2rgb",
- "hypot",
- "i",
- "ichol",
- "idealfilter",
- "idivide",
- "ifft",
- "ifft2",
- "ifftn",
- "ifftshift",
- "ilu",
- "im2double",
- "im2frame",
- "im2gray",
- "im2java",
- "imag",
- "image",
- "imageDatastore",
- "imagesc",
- "imapprox",
- "imfinfo",
- "imformats",
- "imgCompress",
- "import",
- "importdata",
- "imread",
- "imresize",
- "imshow",
- "imtile",
- "imwrite",
- "inShape",
- "incenter",
- "incidence",
- "ind2rgb",
- "ind2sub",
- "indegree",
- "inedges",
- "infoImpl",
- "inmem",
- "inner2outer",
- "innerjoin",
- "inpolygon",
- "input",
- "inputParser",
- "inputdlg",
- "inputname",
- "insertATbl",
- "insertAfter",
- "insertBTbl",
- "insertBefore",
- "insertCol",
- "insertImg",
- "insertRows",
- "int16",
- "int2str",
- "int32",
- "int64",
- "int8",
- "integral",
- "integral2",
- "integral3",
- "interp1",
- "interp2",
- "interp3",
- "interpft",
- "interpn",
- "interpstreamspeed",
- "intersect",
- "intmax",
- "intmin",
- "inv",
- "invhilb",
- "ipermute",
- "iqr",
- "isCompressedImg",
- "isConnected",
- "isDiscreteStateSpecificationMutableImpl",
- "isDone",
- "isDoneImpl",
- "isInactivePropertyImpl",
- "isInputComplexityMutableImpl",
- "isInputDataTypeMutableImpl",
- "isInputSizeMutableImpl",
- "isInterior",
- "isKey",
- "isLoaded",
- "isLocked",
- "isMATLABReleaseOlderThan",
- "isPartitionable",
- "isShuffleable",
- "isStringScalar",
- "isTunablePropertyDataTypeMutableImpl",
- "isUnderlyingType",
- "isa",
- "isaUnderlying",
- "isappdata",
- "isbanded",
- "isbetween",
- "iscalendarduration",
- "iscategorical",
- "iscategory",
- "iscell",
- "iscellstr",
- "ischange",
- "ischar",
- "iscolumn",
- "iscom",
- "isdag",
- "isdatetime",
- "isdiag",
- "isdst",
- "isduration",
- "isempty",
- "isenum",
- "isequal",
- "isequaln",
- "isevent",
- "isfield",
- "isfile",
- "isfinite",
- "isfloat",
- "isfolder",
- "isgraphics",
- "ishandle",
- "ishermitian",
- "ishold",
- "ishole",
- "isinf",
- "isinteger",
- "isinterface",
- "isinterior",
- "isisomorphic",
- "isjava",
- "iskeyword",
- "isletter",
- "islocalmax",
- "islocalmin",
- "islogical",
- "ismac",
- "ismatrix",
- "ismember",
- "ismembertol",
- "ismethod",
- "ismissing",
- "ismultigraph",
- "isnan",
- "isnat",
- "isnumeric",
- "isobject",
- "isocaps",
- "isocolors",
- "isomorphism",
- "isonormals",
- "isordinal",
- "isosurface",
- "isoutlier",
- "ispc",
- "isplaying",
- "ispref",
- "isprime",
- "isprop",
- "isprotected",
- "isreal",
- "isrecording",
- "isregular",
- "isrow",
- "isscalar",
- "issimplified",
- "issorted",
- "issortedrows",
- "isspace",
- "issparse",
- "isstring",
- "isstrprop",
- "isstruct",
- "isstudent",
- "issymmetric",
- "istable",
- "istall",
- "istimetable",
- "istril",
- "istriu",
- "isundefined",
- "isunix",
- "isvalid",
- "isvarname",
- "isvector",
- "isweekend",
- "j",
- "javaArray",
- "javaMethod",
- "javaMethodEDT",
- "javaObject",
- "javaObjectEDT",
- "javaaddpath",
- "javachk",
- "javaclasspath",
- "javarmpath",
- "jet",
- "join",
- "jsondecode",
- "jsonencode",
- "juliandate",
- "keyboard",
- "keys",
- "kron",
- "labeledge",
- "labelnode",
- "lag",
- "laplacian",
- "lastwarn",
- "layout",
- "lcm",
- "ldl",
- "leapseconds",
- "legend",
- "legendre",
- "length",
- "letterBoundary",
- "lettersPattern",
- "lib.pointer",
- "libfunctions",
- "libfunctionsview",
- "libisloaded",
- "libpointer",
- "libstruct",
- "license",
- "light",
- "lightangle",
- "lighting",
- "lin2mu",
- "line",
- "lineBoundary",
- "lines",
- "linkaxes",
- "linkdata",
- "linkprop",
- "linsolve",
- "linspace",
- "listModifiedFiles",
- "listRequiredFiles",
- "listdlg",
- "listener",
- "listfonts",
- "load",
- "loadObjectImpl",
- "loadlibrary",
- "loadobj",
- "localfunctions",
- "log",
- "log10",
- "log1p",
- "log2",
- "logical",
- "loglog",
- "logm",
- "logspace",
- "lookAheadBoundary",
- "lookBehindBoundary",
- "lookfor",
- "lower",
- "ls",
- "lscov",
- "lsqminnorm",
- "lsqnonneg",
- "lsqr",
- "lu",
- "magic",
- "makehgtform",
- "makima",
- "mapreduce",
- "mapreducer",
- "maskedPattern",
- "mat2cell",
- "mat2str",
- "matches",
- "matchpairs",
- "material",
- "matfile",
- "matlab.System",
- "matlab.addons.disableAddon",
- "matlab.addons.enableAddon",
- "matlab.addons.install",
- "matlab.addons.installedAddons",
- "matlab.addons.isAddonEnabled",
- "matlab.addons.toolbox.installToolbox",
- "matlab.addons.toolbox.installedToolboxes",
- "matlab.addons.toolbox.packageToolbox",
- "matlab.addons.toolbox.toolboxVersion",
- "matlab.addons.toolbox.uninstallToolbox",
- "matlab.addons.uninstall",
- "matlab.apputil.create",
- "matlab.apputil.getInstalledAppInfo",
- "matlab.apputil.install",
- "matlab.apputil.package",
- "matlab.apputil.run",
- "matlab.apputil.uninstall",
- "matlab.codetools.requiredFilesAndProducts",
- "matlab.engine.FutureResult",
- "matlab.engine.MatlabEngine",
- "matlab.engine.connect_matlab",
- "matlab.engine.engineName",
- "matlab.engine.find_matlab",
- "matlab.engine.isEngineShared",
- "matlab.engine.shareEngine",
- "matlab.engine.start_matlab",
- "matlab.exception.JavaException",
- "matlab.exception.PyException",
- "matlab.graphics.chartcontainer.ChartContainer",
- "matlab.graphics.chartcontainer.mixin.Colorbar",
- "matlab.graphics.chartcontainer.mixin.Legend",
- "matlab.io.Datastore",
- "matlab.io.datastore.BlockedFileSet",
- "matlab.io.datastore.DsFileReader",
- "matlab.io.datastore.DsFileSet",
- "matlab.io.datastore.FileSet",
- "matlab.io.datastore.FileWritable",
- "matlab.io.datastore.FoldersPropertyProvider",
- "matlab.io.datastore.HadoopLocationBased",
- "matlab.io.datastore.Partitionable",
- "matlab.io.datastore.Shuffleable",
- "matlab.io.hdf4.sd",
- "matlab.io.hdfeos.gd",
- "matlab.io.hdfeos.sw",
- "matlab.io.saveVariablesToScript",
- "matlab.lang.OnOffSwitchState",
- "matlab.lang.correction.AppendArgumentsCorrection",
- "matlab.lang.correction.ConvertToFunctionNotationCorrection",
- "matlab.lang.correction.ReplaceIdentifierCorrection",
- "matlab.lang.makeUniqueStrings",
- "matlab.lang.makeValidName",
- "matlab.mex.MexHost",
- "matlab.mixin.Copyable",
- "matlab.mixin.CustomDisplay",
- "matlab.mixin.Heterogeneous",
- "matlab.mixin.SetGet",
- "matlab.mixin.SetGetExactNames",
- "matlab.mixin.util.PropertyGroup",
- "matlab.mock.AnyArguments",
- "matlab.mock.InteractionHistory",
- "matlab.mock.InteractionHistory.forMock",
- "matlab.mock.MethodCallBehavior",
- "matlab.mock.PropertyBehavior",
- "matlab.mock.PropertyGetBehavior",
- "matlab.mock.PropertySetBehavior",
- "matlab.mock.TestCase",
- "matlab.mock.actions.AssignOutputs",
- "matlab.mock.actions.DoNothing",
- "matlab.mock.actions.Invoke",
- "matlab.mock.actions.ReturnStoredValue",
- "matlab.mock.actions.StoreValue",
- "matlab.mock.actions.ThrowException",
- "matlab.mock.constraints.Occurred",
- "matlab.mock.constraints.WasAccessed",
- "matlab.mock.constraints.WasCalled",
- "matlab.mock.constraints.WasSet",
- "matlab.net.ArrayFormat",
- "matlab.net.QueryParameter",
- "matlab.net.URI",
- "matlab.net.base64decode",
- "matlab.net.base64encode",
- "matlab.net.http.AuthInfo",
- "matlab.net.http.AuthenticationScheme",
- "matlab.net.http.Cookie",
- "matlab.net.http.CookieInfo",
- "matlab.net.http.Credentials",
- "matlab.net.http.Disposition",
- "matlab.net.http.HTTPException",
- "matlab.net.http.HTTPOptions",
- "matlab.net.http.HeaderField",
- "matlab.net.http.LogRecord",
- "matlab.net.http.MediaType",
- "matlab.net.http.Message",
- "matlab.net.http.MessageBody",
- "matlab.net.http.MessageType",
- "matlab.net.http.ProgressMonitor",
- "matlab.net.http.ProtocolVersion",
- "matlab.net.http.RequestLine",
- "matlab.net.http.RequestMessage",
- "matlab.net.http.RequestMethod",
- "matlab.net.http.ResponseMessage",
- "matlab.net.http.StartLine",
- "matlab.net.http.StatusClass",
- "matlab.net.http.StatusCode",
- "matlab.net.http.StatusLine",
- "matlab.net.http.field.AcceptField",
- "matlab.net.http.field.AuthenticateField",
- "matlab.net.http.field.AuthenticationInfoField",
- "matlab.net.http.field.AuthorizationField",
- "matlab.net.http.field.ContentDispositionField",
- "matlab.net.http.field.ContentLengthField",
- "matlab.net.http.field.ContentLocationField",
- "matlab.net.http.field.ContentTypeField",
- "matlab.net.http.field.CookieField",
- "matlab.net.http.field.DateField",
- "matlab.net.http.field.GenericField",
- "matlab.net.http.field.GenericParameterizedField",
- "matlab.net.http.field.HTTPDateField",
- "matlab.net.http.field.IntegerField",
- "matlab.net.http.field.LocationField",
- "matlab.net.http.field.MediaRangeField",
- "matlab.net.http.field.SetCookieField",
- "matlab.net.http.field.URIReferenceField",
- "matlab.net.http.io.BinaryConsumer",
- "matlab.net.http.io.ContentConsumer",
- "matlab.net.http.io.ContentProvider",
- "matlab.net.http.io.FileConsumer",
- "matlab.net.http.io.FileProvider",
- "matlab.net.http.io.FormProvider",
- "matlab.net.http.io.GenericConsumer",
- "matlab.net.http.io.GenericProvider",
- "matlab.net.http.io.ImageConsumer",
- "matlab.net.http.io.ImageProvider",
- "matlab.net.http.io.JSONConsumer",
- "matlab.net.http.io.JSONProvider",
- "matlab.net.http.io.MultipartConsumer",
- "matlab.net.http.io.MultipartFormProvider",
- "matlab.net.http.io.MultipartProvider",
- "matlab.net.http.io.StringConsumer",
- "matlab.net.http.io.StringProvider",
- "matlab.perftest.FixedTimeExperiment",
- "matlab.perftest.FrequentistTimeExperiment",
- "matlab.perftest.TestCase",
- "matlab.perftest.TimeExperiment",
- "matlab.perftest.TimeResult",
- "matlab.project.Project",
- "matlab.project.convertDefinitionFiles",
- "matlab.project.createProject",
- "matlab.project.deleteProject",
- "matlab.project.loadProject",
- "matlab.project.rootProject",
- "matlab.settings.FactoryGroup.createToolboxGroup",
- "matlab.settings.SettingsFileUpgrader",
- "matlab.settings.loadSettingsCompatibilityResults",
- "matlab.settings.mustBeIntegerScalar",
- "matlab.settings.mustBeLogicalScalar",
- "matlab.settings.mustBeNumericScalar",
- "matlab.settings.mustBeStringScalar",
- "matlab.settings.reloadFactoryFile",
- "matlab.system.mixin.FiniteSource",
- "matlab.tall.blockMovingWindow",
- "matlab.tall.movingWindow",
- "matlab.tall.reduce",
- "matlab.tall.transform",
- "matlab.test.behavior.Missing",
- "matlab.ui.componentcontainer.ComponentContainer",
- "matlab.uitest.TestCase",
- "matlab.uitest.TestCase.forInteractiveUse",
- "matlab.uitest.unlock",
- "matlab.unittest.Test",
- "matlab.unittest.TestCase",
- "matlab.unittest.TestResult",
- "matlab.unittest.TestRunner",
- "matlab.unittest.TestSuite",
- "matlab.unittest.constraints.BooleanConstraint",
- "matlab.unittest.constraints.Constraint",
- "matlab.unittest.constraints.Tolerance",
- "matlab.unittest.diagnostics.ConstraintDiagnostic",
- "matlab.unittest.diagnostics.Diagnostic",
- "matlab.unittest.fixtures.Fixture",
- "matlab.unittest.measurement.DefaultMeasurementResult",
- "matlab.unittest.measurement.MeasurementResult",
- "matlab.unittest.measurement.chart.ComparisonPlot",
- "matlab.unittest.plugins.OutputStream",
- "matlab.unittest.plugins.Parallelizable",
- "matlab.unittest.plugins.QualifyingPlugin",
- "matlab.unittest.plugins.TestRunnerPlugin",
- "matlab.wsdl.createWSDLClient",
- "matlab.wsdl.setWSDLToolPath",
- "matlabRelease",
- "matlabrc",
- "matlabroot",
- "max",
- "maxflow",
- "maxk",
- "mean",
- "median",
- "memmapfile",
- "memoize",
- "memory",
- "mergecats",
- "mergevars",
- "mesh",
- "meshc",
- "meshgrid",
- "meshz",
- "meta.ArrayDimension",
- "meta.DynamicProperty",
- "meta.EnumeratedValue",
- "meta.FixedDimension",
- "meta.MetaData",
- "meta.UnrestrictedDimension",
- "meta.Validation",
- "meta.abstractDetails",
- "meta.class",
- "meta.class.fromName",
- "meta.event",
- "meta.method",
- "meta.package",
- "meta.package.fromName",
- "meta.package.getAllPackages",
- "meta.property",
- "metaclass",
- "methods",
- "methodsview",
- "mex",
- "mexext",
- "mexhost",
- "mfilename",
- "mget",
- "milliseconds",
- "min",
- "mink",
- "minres",
- "minspantree",
- "minute",
- "minutes",
- "mislocked",
- "missing",
- "mkdir",
- "mkpp",
- "mldivide",
- "mlintrpt",
- "mlock",
- "mmfileinfo",
- "mod",
- "mode",
- "month",
- "more",
- "morebins",
- "movAbsHDU",
- "movNamHDU",
- "movRelHDU",
- "move",
- "movefile",
- "movegui",
- "movevars",
- "movie",
- "movmad",
- "movmax",
- "movmean",
- "movmedian",
- "movmin",
- "movprod",
- "movstd",
- "movsum",
- "movvar",
- "mpower",
- "mput",
- "mrdivide",
- "msgbox",
- "mtimes",
- "mu2lin",
- "multibandread",
- "multibandwrite",
- "munlock",
- "mustBeA",
- "mustBeFile",
- "mustBeFinite",
- "mustBeFloat",
- "mustBeFolder",
- "mustBeGreaterThan",
- "mustBeGreaterThanOrEqual",
- "mustBeInRange",
- "mustBeInteger",
- "mustBeLessThan",
- "mustBeLessThanOrEqual",
- "mustBeMember",
- "mustBeNegative",
- "mustBeNonNan",
- "mustBeNonempty",
- "mustBeNonmissing",
- "mustBeNonnegative",
- "mustBeNonpositive",
- "mustBeNonsparse",
- "mustBeNonzero",
- "mustBeNonzeroLengthText",
- "mustBeNumeric",
- "mustBeNumericOrLogical",
- "mustBePositive",
- "mustBeReal",
- "mustBeScalarOrEmpty",
- "mustBeText",
- "mustBeTextScalar",
- "mustBeUnderlyingType",
- "mustBeValidVariableName",
- "mustBeVector",
- "namedPattern",
- "namedargs2cell",
- "namelengthmax",
- "nargin",
- "narginchk",
- "nargout",
- "nargoutchk",
- "native2unicode",
- "nccreate",
- "ncdisp",
- "nchoosek",
- "ncinfo",
- "ncread",
- "ncreadatt",
- "ncwrite",
- "ncwriteatt",
- "ncwriteschema",
- "ndgrid",
- "ndims",
- "nearest",
- "nearestNeighbor",
- "nearestvertex",
- "neighbors",
- "netcdf.abort",
- "netcdf.close",
- "netcdf.copyAtt",
- "netcdf.create",
- "netcdf.defDim",
- "netcdf.defGrp",
- "netcdf.defVar",
- "netcdf.defVarChunking",
- "netcdf.defVarDeflate",
- "netcdf.defVarFill",
- "netcdf.defVarFletcher32",
- "netcdf.delAtt",
- "netcdf.endDef",
- "netcdf.getAtt",
- "netcdf.getChunkCache",
- "netcdf.getConstant",
- "netcdf.getConstantNames",
- "netcdf.getVar",
- "netcdf.inq",
- "netcdf.inqAtt",
- "netcdf.inqAttID",
- "netcdf.inqAttName",
- "netcdf.inqDim",
- "netcdf.inqDimID",
- "netcdf.inqDimIDs",
- "netcdf.inqFormat",
- "netcdf.inqGrpName",
- "netcdf.inqGrpNameFull",
- "netcdf.inqGrpParent",
- "netcdf.inqGrps",
- "netcdf.inqLibVers",
- "netcdf.inqNcid",
- "netcdf.inqUnlimDims",
- "netcdf.inqVar",
- "netcdf.inqVarChunking",
- "netcdf.inqVarDeflate",
- "netcdf.inqVarFill",
- "netcdf.inqVarFletcher32",
- "netcdf.inqVarID",
- "netcdf.inqVarIDs",
- "netcdf.open",
- "netcdf.putAtt",
- "netcdf.putVar",
- "netcdf.reDef",
- "netcdf.renameAtt",
- "netcdf.renameDim",
- "netcdf.renameVar",
- "netcdf.setChunkCache",
- "netcdf.setDefaultFormat",
- "netcdf.setFill",
- "netcdf.sync",
- "newline",
- "newplot",
- "nextpow2",
- "nexttile",
- "nnz",
- "nonzeros",
- "norm",
- "normalize",
- "normest",
- "notify",
- "now",
- "nsidedpoly",
- "nthroot",
- "nufft",
- "nufftn",
- "null",
- "num2cell",
- "num2hex",
- "num2ruler",
- "num2str",
- "numArgumentsFromSubscript",
- "numRegions",
- "numboundaries",
- "numedges",
- "numel",
- "numnodes",
- "numpartitions",
- "numsides",
- "nzmax",
- "ode113",
- "ode15i",
- "ode15s",
- "ode23",
- "ode23s",
- "ode23t",
- "ode23tb",
- "ode45",
- "odeget",
- "odeset",
- "odextend",
- "onCleanup",
- "ones",
- "open",
- "openDiskFile",
- "openFile",
- "openProject",
- "openfig",
- "opengl",
- "openvar",
- "optimget",
- "optimset",
- "optionalPattern",
- "ordeig",
- "orderfields",
- "ordqz",
- "ordschur",
- "orient",
- "orth",
- "outdegree",
- "outedges",
- "outerjoin",
- "overlaps",
- "overlapsrange",
- "pack",
- "pad",
- "padecoef",
- "pagectranspose",
- "pagemtimes",
- "pagetranspose",
- "pan",
- "panInteraction",
- "parallelplot",
- "pareto",
- "parquetDatastore",
- "parquetinfo",
- "parquetread",
- "parquetwrite",
- "partition",
- "parula",
- "pascal",
- "patch",
- "path",
- "pathsep",
- "pathtool",
- "pattern",
- "pause",
- "pbaspect",
- "pcg",
- "pchip",
- "pcode",
- "pcolor",
- "pdepe",
- "pdeval",
- "peaks",
- "perimeter",
- "perl",
- "perms",
- "permute",
- "pi",
- "pie",
- "pie3",
- "pink",
- "pinv",
- "planerot",
- "play",
- "playblocking",
- "plot",
- "plot3",
- "plotbrowser",
- "plotedit",
- "plotmatrix",
- "plottools",
- "plus",
- "pointLocation",
- "pol2cart",
- "polaraxes",
- "polarbubblechart",
- "polarhistogram",
- "polarplot",
- "polarscatter",
- "poly",
- "polyarea",
- "polybuffer",
- "polyder",
- "polyeig",
- "polyfit",
- "polyint",
- "polyshape",
- "polyval",
- "polyvalm",
- "posixtime",
- "possessivePattern",
- "pow2",
- "ppval",
- "predecessors",
- "prefdir",
- "preferences",
- "press",
- "preview",
- "primes",
- "print",
- "printdlg",
- "printopt",
- "printpreview",
- "prism",
- "processInputSpecificationChangeImpl",
- "processTunedPropertiesImpl",
- "prod",
- "profile",
- "propedit",
- "properties",
- "propertyeditor",
- "psi",
- "publish",
- "pwd",
- "pyargs",
- "pyenv",
- "qmr",
- "qr",
- "qrdelete",
- "qrinsert",
- "qrupdate",
- "quad2d",
- "quadgk",
- "quarter",
- "questdlg",
- "quit",
- "quiver",
- "quiver3",
- "qz",
- "rad2deg",
- "rand",
- "randi",
- "randn",
- "randperm",
- "rank",
- "rat",
- "rats",
- "rbbox",
- "rcond",
- "read",
- "readATblHdr",
- "readBTblHdr",
- "readCard",
- "readCol",
- "readFrame",
- "readImg",
- "readKey",
- "readKeyCmplx",
- "readKeyDbl",
- "readKeyLongLong",
- "readKeyLongStr",
- "readKeyUnit",
- "readRecord",
- "readall",
- "readcell",
- "readline",
- "readlines",
- "readmatrix",
- "readstruct",
- "readtable",
- "readtimetable",
- "readvars",
- "real",
- "reallog",
- "realmax",
- "realmin",
- "realpow",
- "realsqrt",
- "record",
- "recordblocking",
- "rectangle",
- "rectint",
- "recycle",
- "reducepatch",
- "reducevolume",
- "refresh",
- "refreshSourceControl",
- "refreshdata",
- "regexp",
- "regexpPattern",
- "regexpi",
- "regexprep",
- "regexptranslate",
- "regionZoomInteraction",
- "regions",
- "registerevent",
- "regmatlabserver",
- "rehash",
- "relationaloperators",
- "release",
- "releaseImpl",
- "reload",
- "rem",
- "remove",
- "removeCategory",
- "removeFile",
- "removeGroup",
- "removeLabel",
- "removePath",
- "removeReference",
- "removeSetting",
- "removeShortcut",
- "removeShutdownFile",
- "removeStartupFile",
- "removeStyle",
- "removeToolbarExplorationButtons",
- "removecats",
- "removets",
- "removevars",
- "rename",
- "renamecats",
- "renamevars",
- "rendererinfo",
- "reordercats",
- "reordernodes",
- "repelem",
- "replace",
- "replaceBetween",
- "repmat",
- "resample",
- "rescale",
- "reset",
- "resetImpl",
- "reshape",
- "residue",
- "restoredefaultpath",
- "resume",
- "rethrow",
- "retime",
- "reverse",
- "rgb2gray",
- "rgb2hsv",
- "rgb2ind",
- "rgbplot",
- "ribbon",
- "rlim",
- "rmappdata",
- "rmboundary",
- "rmdir",
- "rmedge",
- "rmfield",
- "rmholes",
- "rmmissing",
- "rmnode",
- "rmoutliers",
- "rmpath",
- "rmpref",
- "rmprop",
- "rmslivers",
- "rng",
- "roots",
- "rosser",
- "rot90",
- "rotate",
- "rotate3d",
- "rotateInteraction",
- "round",
- "rowfun",
- "rows2vars",
- "rref",
- "rsf2csf",
- "rtickangle",
- "rtickformat",
- "rticklabels",
- "rticks",
- "ruler2num",
- "rulerPanInteraction",
- "run",
- "runChecks",
- "runperf",
- "runtests",
- "save",
- "saveObjectImpl",
- "saveas",
- "savefig",
- "saveobj",
- "savepath",
- "scale",
- "scatter",
- "scatter3",
- "scatteredInterpolant",
- "scatterhistogram",
- "schur",
- "scroll",
- "sec",
- "secd",
- "sech",
- "second",
- "seconds",
- "semilogx",
- "semilogy",
- "sendmail",
- "serialport",
- "serialportlist",
- "set",
- "setBscale",
- "setCompressionType",
- "setDTR",
- "setHCompScale",
- "setHCompSmooth",
- "setProperties",
- "setRTS",
- "setTileDim",
- "setTscale",
- "setabstime",
- "setappdata",
- "setcats",
- "setdiff",
- "setenv",
- "setfield",
- "setinterpmethod",
- "setpixelposition",
- "setpref",
- "settimeseriesnames",
- "settings",
- "setuniformtime",
- "setup",
- "setupImpl",
- "setvaropts",
- "setvartype",
- "setxor",
- "sgtitle",
- "shading",
- "sheetnames",
- "shg",
- "shiftdim",
- "shortestpath",
- "shortestpathtree",
- "showplottool",
- "shrinkfaces",
- "shuffle",
- "sign",
- "simplify",
- "sin",
- "sind",
- "single",
- "sinh",
- "sinpi",
- "size",
- "slice",
- "smooth3",
- "smoothdata",
- "snapnow",
- "sort",
- "sortboundaries",
- "sortregions",
- "sortrows",
- "sortx",
- "sorty",
- "sound",
- "soundsc",
- "spalloc",
- "sparse",
- "spaugment",
- "spconvert",
- "spdiags",
- "specular",
- "speye",
- "spfun",
- "sph2cart",
- "sphere",
- "spinmap",
- "spline",
- "split",
- "splitapply",
- "splitlines",
- "splitvars",
- "spones",
- "spparms",
- "sprand",
- "sprandn",
- "sprandsym",
- "sprank",
- "spreadsheetDatastore",
- "spreadsheetImportOptions",
- "spring",
- "sprintf",
- "spy",
- "sqrt",
- "sqrtm",
- "squeeze",
- "ss2tf",
- "sscanf",
- "stack",
- "stackedplot",
- "stairs",
- "standardizeMissing",
- "start",
- "startat",
- "startsWith",
- "startup",
- "std",
- "stem",
- "stem3",
- "step",
- "stepImpl",
- "stlread",
- "stlwrite",
- "stop",
- "str2double",
- "str2func",
- "str2num",
- "strcat",
- "strcmp",
- "strcmpi",
- "stream2",
- "stream3",
- "streamline",
- "streamparticles",
- "streamribbon",
- "streamslice",
- "streamtube",
- "strfind",
- "string",
- "strings",
- "strip",
- "strjoin",
- "strjust",
- "strlength",
- "strncmp",
- "strncmpi",
- "strrep",
- "strsplit",
- "strtok",
- "strtrim",
- "struct",
- "struct2cell",
- "struct2table",
- "structfun",
- "sub2ind",
- "subgraph",
- "subplot",
- "subsasgn",
- "subscribe",
- "subsindex",
- "subspace",
- "subsref",
- "substruct",
- "subtitle",
- "subtract",
- "subvolume",
- "successors",
- "sum",
- "summary",
- "summer",
- "superclasses",
- "surf",
- "surf2patch",
- "surface",
- "surfaceArea",
- "surfc",
- "surfl",
- "surfnorm",
- "svd",
- "svds",
- "svdsketch",
- "swapbytes",
- "swarmchart",
- "swarmchart3",
- "sylvester",
- "symamd",
- "symbfact",
- "symmlq",
- "symrcm",
- "synchronize",
- "sysobjupdate",
- "system",
- "table",
- "table2array",
- "table2cell",
- "table2struct",
- "table2timetable",
- "tabularTextDatastore",
- "tail",
- "tall",
- "tallrng",
- "tan",
- "tand",
- "tanh",
- "tar",
- "tcpclient",
- "tempdir",
- "tempname",
- "testsuite",
- "tetramesh",
- "texlabel",
- "text",
- "textBoundary",
- "textscan",
- "textwrap",
- "tfqmr",
- "thetalim",
- "thetatickformat",
- "thetaticklabels",
- "thetaticks",
- "thingSpeakRead",
- "thingSpeakWrite",
- "throw",
- "throwAsCaller",
- "tic",
- "tiledlayout",
- "time",
- "timeit",
- "timeofday",
- "timer",
- "timerange",
- "timerfind",
- "timerfindall",
- "timeseries",
- "timetable",
- "timetable2table",
- "timezones",
- "title",
- "toc",
- "todatenum",
- "toeplitz",
- "toolboxdir",
- "topkrows",
- "toposort",
- "trace",
- "transclosure",
- "transform",
- "translate",
- "transpose",
- "transreduction",
- "trapz",
- "treelayout",
- "treeplot",
- "triangulation",
- "tril",
- "trimesh",
- "triplot",
- "trisurf",
- "triu",
- "true",
- "tscollection",
- "tsdata.event",
- "tsearchn",
- "turbo",
- "turningdist",
- "type",
- "typecast",
- "tzoffset",
- "uialert",
- "uiaxes",
- "uibutton",
- "uibuttongroup",
- "uicheckbox",
- "uiconfirm",
- "uicontextmenu",
- "uicontrol",
- "uidatepicker",
- "uidropdown",
- "uieditfield",
- "uifigure",
- "uigauge",
- "uigetdir",
- "uigetfile",
- "uigetpref",
- "uigridlayout",
- "uihtml",
- "uiimage",
- "uiknob",
- "uilabel",
- "uilamp",
- "uilistbox",
- "uimenu",
- "uint16",
- "uint32",
- "uint64",
- "uint8",
- "uiopen",
- "uipanel",
- "uiprogressdlg",
- "uipushtool",
- "uiputfile",
- "uiradiobutton",
- "uiresume",
- "uisave",
- "uisetcolor",
- "uisetfont",
- "uisetpref",
- "uislider",
- "uispinner",
- "uistack",
- "uistyle",
- "uiswitch",
- "uitab",
- "uitabgroup",
- "uitable",
- "uitextarea",
- "uitogglebutton",
- "uitoggletool",
- "uitoolbar",
- "uitree",
- "uitreenode",
- "uiwait",
- "uminus",
- "underlyingType",
- "underlyingValue",
- "unicode2native",
- "union",
- "unique",
- "uniquetol",
- "unix",
- "unloadlibrary",
- "unmesh",
- "unmkpp",
- "unregisterallevents",
- "unregisterevent",
- "unstack",
- "unsubscribe",
- "untar",
- "unwrap",
- "unzip",
- "update",
- "updateDependencies",
- "uplus",
- "upper",
- "usejava",
- "userpath",
- "validateFunctionSignaturesJSON",
- "validateInputsImpl",
- "validatePropertiesImpl",
- "validateattributes",
- "validatecolor",
- "validatestring",
- "values",
- "vander",
- "var",
- "varargin",
- "varargout",
- "varfun",
- "vartype",
- "vecnorm",
- "ver",
- "verLessThan",
- "version",
- "vertcat",
- "vertexAttachments",
- "vertexNormal",
- "view",
- "viewmtx",
- "visdiff",
- "volume",
- "volumebounds",
- "voronoi",
- "voronoiDiagram",
- "voronoin",
- "wait",
- "waitbar",
- "waitfor",
- "waitforbuttonpress",
- "warndlg",
- "warning",
- "waterfall",
- "web",
- "weboptions",
- "webread",
- "websave",
- "webwrite",
- "week",
- "weekday",
- "what",
- "which",
- "whitespaceBoundary",
- "whitespacePattern",
- "who",
- "whos",
- "width",
- "wildcardPattern",
- "wilkinson",
- "winopen",
- "winqueryreg",
- "winter",
- "withinrange",
- "withtol",
- "wordcloud",
- "write",
- "writeChecksum",
- "writeCol",
- "writeComment",
- "writeDate",
- "writeHistory",
- "writeImg",
- "writeKey",
- "writeKeyUnit",
- "writeVideo",
- "writeall",
- "writecell",
- "writeline",
- "writematrix",
- "writestruct",
- "writetable",
- "writetimetable",
- "xcorr",
- "xcov",
- "xlabel",
- "xlim",
- "xline",
- "xmlread",
- "xmlwrite",
- "xor",
- "xslt",
- "xtickangle",
- "xtickformat",
- "xticklabels",
- "xticks",
- "year",
- "years",
- "ylabel",
- "ylim",
- "yline",
- "ymd",
- "ytickangle",
- "ytickformat",
- "yticklabels",
- "yticks",
- "yyaxis",
- "yyyymmdd",
- "zeros",
- "zip",
- "zlabel",
- "zlim",
- "zoom",
- "zoomInteraction",
- "ztickangle",
- "ztickformat",
- "zticklabels",
- "zticks",
- ],
- prefix=r"(?<!\.)(", # Exclude field names
- suffix=r")\b"
- ),
- Name.Builtin
- ),
- # line continuation with following comment:
- (r'(\.\.\.)(.*)$', bygroups(Keyword, Comment)),
- # command form:
- # "How MATLAB Recognizes Command Syntax" specifies that an operator
- # is recognized if it is either surrounded by spaces or by no
- # spaces on both sides (this allows distinguishing `cd ./foo` from
- # `cd ./ foo`.). Here, the regex checks that the first word in the
- # line is not followed by <spaces> and then
- # (equal | open-parenthesis | <operator><space> | <space>).
- (rf'(?:^|(?<=;))(\s*)(\w+)(\s+)(?!=|\(|{_operators}\s|\s)',
- bygroups(Whitespace, Name, Whitespace), 'commandargs'),
- include('expressions')
- ],
- 'blockcomment': [
- (r'^\s*%\}', Comment.Multiline, '#pop'),
- (r'^.*\n', Comment.Multiline),
- (r'.', Comment.Multiline),
- ],
- 'deffunc': [
- (r'(\s*)(?:(\S+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)',
- bygroups(Whitespace, Name.Function), '#pop'),
- ],
- 'propattrs': [
- (r'(\w+)(\s*)(=)(\s*)(\d+)',
- bygroups(Name.Builtin, Whitespace, Punctuation, Whitespace,
- Number)),
- (r'(\w+)(\s*)(=)(\s*)([a-zA-Z]\w*)',
- bygroups(Name.Builtin, Whitespace, Punctuation, Whitespace,
- Keyword)),
- (r',', Punctuation),
- (r'\)', Punctuation, '#pop'),
- (r'\s+', Whitespace),
- (r'.', Text),
- ],
- 'defprops': [
- (r'%\{\s*\n', Comment.Multiline, 'blockcomment'),
- (r'%.*$', Comment),
- (r'(?<!\.)end\b', Keyword, '#pop'),
- include('expressions'),
- ],
- 'string': [
- (r"[^']*'", String, '#pop'),
- ],
- 'commandargs': [
- # If an equal sign or other operator is encountered, this
- # isn't a command. It might be a variable assignment or
- # comparison operation with multiple spaces before the
- # equal sign or operator
- (r"=", Punctuation, '#pop'),
- (_operators, Operator, '#pop'),
- (r"[ \t]+", Whitespace),
- ("'[^']*'", String),
- (r"[^';\s]+", String),
- (";", Punctuation, '#pop'),
- default('#pop'),
- ]
- }
- def analyse_text(text):
- # function declaration.
- first_non_comment = next((line for line in text.splitlines()
- if not re.match(r'^\s*%', text)), '').strip()
- if (first_non_comment.startswith('function')
- and '{' not in first_non_comment):
- return 1.
- # comment
- elif re.search(r'^\s*%', text, re.M):
- return 0.2
- # system cmd
- elif re.search(r'^!\w+', text, re.M):
- return 0.2
- line_re = re.compile('.*?\n')
- class MatlabSessionLexer(Lexer):
- """
- For Matlab sessions. Modeled after PythonConsoleLexer.
- Contributed by Ken Schutte <kschutte@csail.mit.edu>.
- """
- name = 'Matlab session'
- aliases = ['matlabsession']
- url = 'https://www.mathworks.com/products/matlab.html'
- version_added = '0.10'
- def get_tokens_unprocessed(self, text):
- mlexer = MatlabLexer(**self.options)
- curcode = ''
- insertions = []
- continuation = False
- for match in line_re.finditer(text):
- line = match.group()
- if line.startswith('>> '):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:3])]))
- curcode += line[3:]
- elif line.startswith('>>'):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:2])]))
- curcode += line[2:]
- elif line.startswith('???'):
- idx = len(curcode)
- # without is showing error on same line as before...?
- # line = "\n" + line
- token = (0, Generic.Traceback, line)
- insertions.append((idx, [token]))
- elif continuation and insertions:
- # line_start is the length of the most recent prompt symbol
- line_start = len(insertions[-1][-1][-1])
- # Set leading spaces with the length of the prompt to be a generic prompt
- # This keeps code aligned when prompts are removed, say with some Javascript
- if line.startswith(' '*line_start):
- insertions.append(
- (len(curcode), [(0, Generic.Prompt, line[:line_start])]))
- curcode += line[line_start:]
- else:
- curcode += line
- else:
- if curcode:
- yield from do_insertions(
- insertions, mlexer.get_tokens_unprocessed(curcode))
- curcode = ''
- insertions = []
- yield match.start(), Generic.Output, line
- # Does not allow continuation if a comment is included after the ellipses.
- # Continues any line that ends with ..., even comments (lines that start with %)
- if line.strip().endswith('...'):
- continuation = True
- else:
- continuation = False
- if curcode: # or item:
- yield from do_insertions(
- insertions, mlexer.get_tokens_unprocessed(curcode))
- class OctaveLexer(RegexLexer):
- """
- For GNU Octave source code.
- """
- name = 'Octave'
- url = 'https://www.gnu.org/software/octave/index'
- aliases = ['octave']
- filenames = ['*.m']
- mimetypes = ['text/octave']
- version_added = '1.5'
- # These lists are generated automatically.
- # Run the following in bash shell:
- #
- # First dump all of the Octave manual into a plain text file:
- #
- # $ info octave --subnodes -o octave-manual
- #
- # Now grep through it:
- # for i in \
- # "Built-in Function" "Command" "Function File" \
- # "Loadable Function" "Mapping Function";
- # do
- # perl -e '@name = qw('"$i"');
- # print lc($name[0]),"_kw = [\n"';
- #
- # perl -n -e 'print "\"$1\",\n" if /-- '"$i"': .* (\w*) \(/;' \
- # octave-manual | sort | uniq ;
- # echo "]" ;
- # echo;
- # done
- # taken from Octave Mercurial changeset 8cc154f45e37 (30-jan-2011)
- builtin_kw = (
- "addlistener", "addpath", "addproperty", "all",
- "and", "any", "argnames", "argv", "assignin",
- "atexit", "autoload",
- "available_graphics_toolkits", "beep_on_error",
- "bitand", "bitmax", "bitor", "bitshift", "bitxor",
- "cat", "cell", "cellstr", "char", "class", "clc",
- "columns", "command_line_path",
- "completion_append_char", "completion_matches",
- "complex", "confirm_recursive_rmdir", "cputime",
- "crash_dumps_octave_core", "ctranspose", "cumprod",
- "cumsum", "debug_on_error", "debug_on_interrupt",
- "debug_on_warning", "default_save_options",
- "dellistener", "diag", "diff", "disp",
- "doc_cache_file", "do_string_escapes", "double",
- "drawnow", "e", "echo_executing_commands", "eps",
- "eq", "errno", "errno_list", "error", "eval",
- "evalin", "exec", "exist", "exit", "eye", "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",
- "horzcat", "hypot", "ifelse",
- "ignore_function_time_stamp", "inferiorto",
- "info_file", "info_program", "inline", "input",
- "intmax", "intmin", "ipermute",
- "is_absolute_filename", "isargout", "isbool",
- "iscell", "iscellstr", "ischar", "iscomplex",
- "isempty", "isfield", "isfloat", "isglobal",
- "ishandle", "isieee", "isindex", "isinteger",
- "islogical", "ismatrix", "ismethod", "isnull",
- "isnumeric", "isobject", "isreal",
- "is_rooted_relative_filename", "issorted",
- "isstruct", "isvarname", "kbhit", "keyboard",
- "kill", "lasterr", "lasterror", "lastwarn",
- "ldivide", "le", "length", "link", "linspace",
- "logical", "lstat", "lt", "make_absolute_filename",
- "makeinfo_program", "max_recursion_depth", "merge",
- "methods", "mfilename", "minus", "mislocked",
- "mkdir", "mkfifo", "mkstemp", "mldivide", "mlock",
- "mouse_wheel_zoom", "mpower", "mrdivide", "mtimes",
- "munlock", "nargin", "nargout",
- "native_float_format", "ndims", "ne", "nfields",
- "nnz", "norm", "not", "numel", "nzmax",
- "octave_config_info", "octave_core_file_limit",
- "octave_core_file_name",
- "octave_core_file_options", "ones", "or",
- "output_max_field_width", "output_precision",
- "page_output_immediately", "page_screen_output",
- "path", "pathsep", "pause", "pclose", "permute",
- "pi", "pipe", "plus", "popen", "power",
- "print_empty_dimensions", "printf",
- "print_struct_array_contents", "prod",
- "program_invocation_name", "program_name",
- "putenv", "puts", "pwd", "quit", "rats", "rdivide",
- "readdir", "readlink", "read_readline_init_file",
- "realmax", "realmin", "rehash", "rename",
- "repelems", "re_read_readline_init_file", "reset",
- "reshape", "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",
- "single", "size", "size_equal", "sizemax",
- "sizeof", "sleep", "source", "sparse_auto_mutate",
- "split_long_rows", "sprintf", "squeeze", "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_no", "zeros",
- "inf", "Inf", "nan", "NaN")
- command_kw = ("close", "load", "who", "whos")
- function_kw = (
- "accumarray", "accumdim", "acosd", "acotd",
- "acscd", "addtodate", "allchild", "ancestor",
- "anova", "arch_fit", "arch_rnd", "arch_test",
- "area", "arma_rnd", "arrayfun", "ascii", "asctime",
- "asecd", "asind", "assert", "atand",
- "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", "blanks",
- "blkdiag", "bone", "box", "brighten", "calendar",
- "cast", "cauchy_cdf", "cauchy_inv", "cauchy_pdf",
- "cauchy_rnd", "caxis", "celldisp", "center", "cgs",
- "chisquare_test_homogeneity",
- "chisquare_test_independence", "circshift", "cla",
- "clabel", "clf", "clock", "cloglog", "closereq",
- "colon", "colorbar", "colormap", "colperm",
- "comet", "common_size", "commutation_matrix",
- "compan", "compare_versions", "compass",
- "computer", "cond", "condest", "contour",
- "contourc", "contourf", "contrast", "conv",
- "convhull", "cool", "copper", "copyfile", "cor",
- "corrcoef", "cor_test", "cosd", "cotd", "cov",
- "cplxpair", "cross", "cscd", "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", "ezsurfc", "factor",
- "factorial", "fail", "fcdf", "feather", "fftconv",
- "fftfilt", "fftshift", "figure", "fileattrib",
- "fileparts", "fill", "findall", "findobj",
- "findstr", "finv", "flag", "flipdim", "fliplr",
- "flipud", "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", "gzip", "hadamard",
- "hamming", "hankel", "hanning", "hggroup",
- "hidden", "hilb", "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", "intersect", "invhilb", "iqr", "isa",
- "isdefinite", "isdir", "is_duplicate_entry",
- "isequal", "isequalwithequalnans", "isfigure",
- "ishermitian", "ishghandle", "is_leap_year",
- "isletter", "ismac", "ismember", "ispc", "isprime",
- "isprop", "isscalar", "issquare", "isstrprop",
- "issymmetric", "isunix", "is_valid_file_id",
- "isvector", "jet", "kendall",
- "kolmogorov_smirnov_cdf",
- "kolmogorov_smirnov_test", "kruskal_wallis_test",
- "krylov", "kurtosis", "laplace_cdf", "laplace_inv",
- "laplace_pdf", "laplace_rnd", "legend", "legendre",
- "license", "line", "linkprop", "list_primes",
- "loadaudio", "loadobj", "logistic_cdf",
- "logistic_inv", "logistic_pdf", "logistic_rnd",
- "logit", "loglog", "loglogerr", "logm", "logncdf",
- "logninv", "lognpdf", "lognrnd", "logspace",
- "lookfor", "ls_command", "lsqnonneg", "magic",
- "mahalanobis", "manova", "matlabroot",
- "mcnemar_test", "mean", "meansq", "median", "menu",
- "mesh", "meshc", "meshgrid", "meshz", "mexext",
- "mget", "mkpp", "mode", "moment", "movefile",
- "mpoles", "mput", "namelengthmax", "nargchk",
- "nargoutchk", "nbincdf", "nbininv", "nbinpdf",
- "nbinrnd", "nchoosek", "ndgrid", "newplot", "news",
- "nonzeros", "normcdf", "normest", "norminv",
- "normpdf", "normrnd", "now", "nthroot", "null",
- "ocean", "ols", "onenormest", "optimget",
- "optimset", "orderfields", "orient", "orth",
- "pack", "pareto", "parseparams", "pascal", "patch",
- "pathdef", "pcg", "pchip", "pcolor", "pcr",
- "peaks", "periodogram", "perl", "perms", "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", "prepad", "primes", "print",
- "print_usage", "prism", "probit", "qp", "qqplot",
- "quadcc", "quadgk", "quadl", "quadv", "quiver",
- "qzhess", "rainbow", "randi", "range", "rank",
- "ranks", "rat", "reallog", "realpow", "realsqrt",
- "record", "rectangle_lw", "rectangle_sw",
- "rectint", "refresh", "refreshdata",
- "regexptranslate", "repmat", "residue", "ribbon",
- "rindex", "roots", "rose", "rosser", "rotdim",
- "rref", "run", "run_count", "rundemos", "run_test",
- "runtests", "saveas", "saveaudio", "saveobj",
- "savepath", "scatter", "secd", "semilogx",
- "semilogxerr", "semilogy", "semilogyerr",
- "setaudio", "setdiff", "setfield", "setxor",
- "shading", "shift", "shiftdim", "sign_test",
- "sinc", "sind", "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", "table",
- "tand", "tar", "tcdf", "tempdir", "tempname",
- "test", "text", "textread", "textscan", "tinv",
- "title", "toeplitz", "tpdf", "trace", "trapz",
- "treelayout", "treeplot", "triangle_lw",
- "triangle_sw", "tril", "trimesh", "triplequad",
- "triplot", "trisurf", "triu", "trnd", "tsearchn",
- "t_test", "t_test_regression", "type", "unidcdf",
- "unidinv", "unidpdf", "unidrnd", "unifcdf",
- "unifinv", "unifpdf", "unifrnd", "union", "unique",
- "unix", "unmkpp", "unpack", "untabify", "untar",
- "unwrap", "unzip", "u_test", "validatestring",
- "vander", "var", "var_test", "vech", "ver",
- "version", "view", "voronoi", "voronoin",
- "waitforbuttonpress", "wavread", "wavwrite",
- "wblcdf", "wblinv", "wblpdf", "wblrnd", "weekday",
- "welch_test", "what", "white", "whitebg",
- "wienrnd", "wilcoxon_test", "wilkinson", "winter",
- "xlabel", "xlim", "ylabel", "yulewalker", "zip",
- "zlabel", "z_test")
- loadable_kw = (
- "airy", "amd", "balance", "besselh", "besseli",
- "besselj", "besselk", "bessely", "bitpack",
- "bsxfun", "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", "dmperm", "dot", "eig", "eigs",
- "endgrent", "endpwent", "etree", "fft", "fftn",
- "fftw", "filter", "find", "full", "gcd",
- "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", "qz", "rand", "rande", "randg",
- "randn", "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")
- mapping_kw = (
- "abs", "acos", "acosh", "acot", "acoth", "acsc",
- "acsch", "angle", "arg", "asec", "asech", "asin",
- "asinh", "atan", "atanh", "beta", "betainc",
- "betaln", "bincoeff", "cbrt", "ceil", "conj", "cos",
- "cosh", "cot", "coth", "csc", "csch", "erf", "erfc",
- "erfcx", "erfinv", "exp", "finite", "fix", "floor",
- "fmod", "gamma", "gammainc", "gammaln", "imag",
- "isalnum", "isalpha", "isascii", "iscntrl",
- "isdigit", "isfinite", "isgraph", "isinf",
- "islower", "isna", "isnan", "isprint", "ispunct",
- "isspace", "isupper", "isxdigit", "lcm", "lgamma",
- "log", "lower", "mod", "real", "rem", "round",
- "roundb", "sec", "sech", "sign", "sin", "sinh",
- "sqrt", "tan", "tanh", "toascii", "tolower", "xor")
- builtin_consts = (
- "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", "WUNTRACED")
- tokens = {
- 'root': [
- (r'%\{\s*\n', Comment.Multiline, 'percentblockcomment'),
- (r'#\{\s*\n', Comment.Multiline, 'hashblockcomment'),
- (r'[%#].*$', Comment),
- (r'^\s*function\b', Keyword, 'deffunc'),
- # from 'iskeyword' on hg changeset 8cc154f45e37
- (words((
- '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef',
- 'continue', 'do', 'else', 'elseif', 'end', 'end_try_catch',
- 'end_unwind_protect', 'endclassdef', 'endevents', 'endfor',
- 'endfunction', 'endif', 'endmethods', 'endproperties', 'endswitch',
- 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if',
- 'methods', 'otherwise', 'persistent', 'properties', 'return',
- 'set', 'static', 'switch', 'try', 'until', 'unwind_protect',
- 'unwind_protect_cleanup', 'while'), suffix=r'\b'),
- Keyword),
- (words(builtin_kw + command_kw + function_kw + loadable_kw + mapping_kw,
- suffix=r'\b'), Name.Builtin),
- (words(builtin_consts, suffix=r'\b'), Name.Constant),
- # operators in Octave but not Matlab:
- (r'-=|!=|!|/=|--', Operator),
- # operators:
- (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
- # operators in Octave but not Matlab requiring escape for re:
- (r'\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*', Operator),
- # operators requiring escape for re:
- (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
- # punctuation:
- (r'[\[\](){}:@.,]', Punctuation),
- (r'=|:|;', Punctuation),
- (r'"[^"]*"', String),
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer),
- # quote can be transpose, instead of string:
- # (not great, but handles common cases...)
- (r'(?<=[\w)\].])\'+', Operator),
- (r'(?<![\w)\].])\'', String, 'string'),
- (r'[a-zA-Z_]\w*', Name),
- (r'\s+', Text),
- (r'.', Text),
- ],
- 'percentblockcomment': [
- (r'^\s*%\}', Comment.Multiline, '#pop'),
- (r'^.*\n', Comment.Multiline),
- (r'.', Comment.Multiline),
- ],
- 'hashblockcomment': [
- (r'^\s*#\}', Comment.Multiline, '#pop'),
- (r'^.*\n', Comment.Multiline),
- (r'.', Comment.Multiline),
- ],
- 'string': [
- (r"[^']*'", String, '#pop'),
- ],
- 'deffunc': [
- (r'(\s*)(?:(\S+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)',
- bygroups(Whitespace, Name.Function), '#pop'),
- ],
- }
- def analyse_text(text):
- """Octave is quite hard to spot, and it looks like Matlab as well."""
- return 0
- class ScilabLexer(RegexLexer):
- """
- For Scilab source code.
- """
- name = 'Scilab'
- url = 'https://www.scilab.org/'
- aliases = ['scilab']
- filenames = ['*.sci', '*.sce', '*.tst']
- mimetypes = ['text/scilab']
- version_added = '1.5'
- tokens = {
- 'root': [
- (r'//.*?$', Comment.Single),
- (r'^\s*function\b', Keyword, 'deffunc'),
- (words((
- '__FILE__', '__LINE__', 'break', 'case', 'catch', 'classdef', 'continue', 'do', 'else',
- 'elseif', 'end', 'end_try_catch', 'end_unwind_protect', 'endclassdef',
- 'endevents', 'endfor', 'endfunction', 'endif', 'endmethods', 'endproperties',
- 'endswitch', 'endwhile', 'events', 'for', 'function', 'get', 'global', 'if', 'methods',
- 'otherwise', 'persistent', 'properties', 'return', 'set', 'static', 'switch', 'try',
- 'until', 'unwind_protect', 'unwind_protect_cleanup', 'while'), suffix=r'\b'),
- Keyword),
- (words(_scilab_builtins.functions_kw +
- _scilab_builtins.commands_kw +
- _scilab_builtins.macros_kw, suffix=r'\b'), Name.Builtin),
- (words(_scilab_builtins.variables_kw, suffix=r'\b'), Name.Constant),
- # operators:
- (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
- # operators requiring escape for re:
- (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
- # punctuation:
- (r'[\[\](){}@.,=:;]+', Punctuation),
- (r'"[^"]*"', String),
- # quote can be transpose, instead of string:
- # (not great, but handles common cases...)
- (r'(?<=[\w)\].])\'+', Operator),
- (r'(?<![\w)\].])\'', String, 'string'),
- (r'(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?', Number.Float),
- (r'\d+[eEf][+-]?[0-9]+', Number.Float),
- (r'\d+', Number.Integer),
- (r'[a-zA-Z_]\w*', Name),
- (r'\s+', Whitespace),
- (r'.', Text),
- ],
- 'string': [
- (r"[^']*'", String, '#pop'),
- (r'.', String, '#pop'),
- ],
- 'deffunc': [
- (r'(\s*)(?:(\S+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
- bygroups(Whitespace, Text, Whitespace, Punctuation,
- Whitespace, Name.Function, Punctuation, Text,
- Punctuation, Whitespace), '#pop'),
- # function with no args
- (r'(\s*)([a-zA-Z_]\w*)', bygroups(Text, Name.Function), '#pop'),
- ],
- }
- # the following is needed to distinguish Scilab and GAP .tst files
- def analyse_text(text):
- score = 0.0
- # Scilab comments (don't appear in e.g. GAP code)
- if re.search(r"^\s*//", text):
- score += 0.1
- if re.search(r"^\s*/\*", text):
- score += 0.1
- return min(score, 1.0)
|