Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide (all?) Matlab built-ins #1705

Merged
merged 2 commits into from
Feb 14, 2021
Merged

Provide (all?) Matlab built-ins #1705

merged 2 commits into from
Feb 14, 2021

Conversation

alexpovel
Copy link
Contributor

@alexpovel alexpovel commented Feb 10, 2021

This PR incorporates the 2500+ long list of the Matlab builtins. This originated from #1684 (here). However, it's somewhat unrelated since it doesn't improve Matlab OOP support as the author there hopes to get done.

I haven't used Matlab in a while but had this list laying around for integration into latex's listings. But a project like pygments is a much better place I reckon.

Some thoughts:

  1. Before submitting the PR I ran make, but the check target errored out the ass. However, pytest alone (on all targets) passes fine (after updating the Matlab goldens accordingly, see 7e70ec0)

    The existing Matlab examplefiles are super short, but we can already see improvements there (Name -> Name.Builtin, e.g. for rand):

  2. black formatting is entirely optional. It's muscle-memory and since I didn't see anything about using specific formatters/styles, I just commited that as well. So this is assuming this project uses no auto-formatter -- please correct me if wrong. Especially the (long) lists with one item on each line has some advantages:

    1. Number of items is easily seen, just subtract end and beginning line numbers
    2. alphabetical ordering makes it easy to add new entries and spot duplicates (there's no duplicates). With the usual style, when adding a new item, the line might become overly full and necessitate a new line break, leading to super unreadable diffs and lots of manual labour
  3. The list of built-ins is now generated using words, it was previously generated "by hand", by just adding the tuples together. This should improve performance thanks to the optimization offered from:

    def regex_opt_inner(strings, open_paren):
    """Return a regex that matches any string in the sorted list of strings."""
    close_paren = open_paren and ')' or ''
    # print strings, repr(open_paren)
    if not strings:
    # print '-> nothing left'
    return ''
    first = strings[0]
    if len(strings) == 1:
    # print '-> only 1 string'
    return open_paren + escape(first) + close_paren
    if not first:
    # print '-> first string empty'
    return open_paren + regex_opt_inner(strings[1:], '(?:') \
    + '?' + close_paren
    if len(first) == 1:
    # multiple one-char strings? make a charset
    oneletter = []
    rest = []
    for s in strings:
    if len(s) == 1:
    oneletter.append(s)
    else:
    rest.append(s)
    if len(oneletter) > 1: # do we have more than one oneletter string?
    if rest:
    # print '-> 1-character + rest'
    return open_paren + regex_opt_inner(rest, '') + '|' \
    + make_charset(oneletter) + close_paren
    # print '-> only 1-character'
    return open_paren + make_charset(oneletter) + close_paren
    prefix = commonprefix(strings)
    if prefix:
    plen = len(prefix)
    # we have a prefix for all strings
    # print '-> prefix:', prefix
    return open_paren + escape(prefix) \
    + regex_opt_inner([s[plen:] for s in strings], '(?:') \
    + close_paren
    # is there a suffix?
    strings_rev = [s[::-1] for s in strings]
    suffix = commonprefix(strings_rev)
    if suffix:
    slen = len(suffix)
    # print '-> suffix:', suffix[::-1]
    return open_paren \
    + regex_opt_inner(sorted(s[:-slen] for s in strings), '(?:') \
    + escape(suffix[::-1]) + close_paren
    # recurse on common 1-string prefixes
    # print '-> last resort'
    return open_paren + \
    '|'.join(regex_opt_inner(list(group[1]), '')
    for group in groupby(strings, lambda s: s[0] == first[0])) \
    + close_paren
    def regex_opt(strings, prefix='', suffix=''):
    """Return a compiled regex that matches any string in the given list.
    The strings to match must be literal strings, not regexes. They will be
    regex-escaped.
    *prefix* and *suffix* are pre- and appended to the final regex.
    """
    strings = sorted(strings)
    return prefix + regex_opt_inner(strings, '(') + suffix

    However, this also of course produces massive regex strings. This is what regex_opt returns for the Keyword category:

    "(?<!\.)(\s*)((break|c(?:a(?:se|tch)|lassdef|ontinue)|dynamicprops|e(?:lse(?:(?:if)?)|nd)|f(?:or|unction)|global|if|methods|otherwise|p(?:arfor|ersistent)|return|s(?:pmd|witch)|try|while))\b"

    And this is produced for the new Name.Builtin category:

    "(?<!\.)((BeginInvoke|C(?:OM|ombine(?:(?:dDatastore)?))|E(?:(?:ndInvok|xecut)e)|F(?:actory(?:Group|Setting)|eval|unctionTestCase)|G(?:et(?:CharArray|FullMatrix|Variable|WorkspaceData)|raphPlot)|H5(?:\.(?:close|g(?:arbage_collect|et_libversion)|open|set_free_list_limits)|A\.(?:c(?:(?:los|reat)e)|delete|get_(?:info|(?:nam|spac|typ)e)|iterate|open(?:(?:_by_(?:idx|name))?)|read|write)|D(?:\.(?:c(?:(?:los|reat)e)|get_(?:access_plist|create_plist|offset|s(?:pace(?:(?:_status)?)|torage_size)|type)|open|read|set_extent|(?:vlen_get_buf_siz|writ)e)|S\.(?:attach_scale|detach_scale|get_(?:label|num_scales|scale_name)|i(?:s_scale|terate_scales)|set_(?:label|scale)))|E\.(?:clear|get_m(?:(?:aj|in)or)|walk)|F\.(?:c(?:(?:los|reat)e)|flush|get_(?:access_plist|create_plist|f(?:(?:ilesiz|reespac)e)|info|mdc_(?:config|(?:hit_rat|siz)e)|name|obj_(?:count|ids))|is_hdf5|mount|open|reopen|set_mdc_config|unmount)|G\.(?:c(?:(?:los|reat)e)|get_info|open)|I\.(?:dec_ref|get_(?:file_id|name|ref|type)|i(?:nc_ref|s_valid))|L\.(?:c(?:opy|reate_(?:external|hard|soft))|delete|exists|get_(?:info|name_by_idx|val)|iterate(?:(?:_by_name)?)|move|visit(?:(?:_by_name)?))|ML\.(?:compare_values|get_(?:constant_(?:names|value)|function_names|mem_datatype))|O\.(?:c(?:lose|opy)|get_(?:comment(?:(?:_by_name)?)|info)|link|open(?:(?:_by_idx)?)|set_comment(?:(?:_by_name)?)|visit(?:(?:_by_name)?))|P\.(?:all_filters_avail|c(?:lose(?:(?:_class)?)|opy|reate)|e(?:qual|xist)|fill_value_defined|get(?:(?:_(?:a(?:l(?:ignment|loc_time)|ttr_(?:creation_order|phase_change))|btree_ratios|c(?:h(?:ar_encoding|unk(?:(?:_cache)?))|lass(?:(?:_(?:name|parent))?)|opy_object|reate_intermediate_group)|driver|e(?:dc_check|xternal(?:(?:_count)?))|f(?:a(?:mily_offset|pl_(?:core|family|multi))|close_degree|il(?:l_(?:(?:tim|valu)e)|ter(?:(?:_by_id)?)))|gc_references|hyper_vector_size|istore_k|l(?:ayout|i(?:bver_bounds|nk_(?:creation_order|phase_change)))|m(?:dc_config|(?:eta_block_siz|ulti_typ)e)|n(?:(?:filter|prop)s)|s(?:i(?:eve_buf_size|ze(?:(?:s)?))|mall_data_block_size|ym_k)|userblock|version))?)|i(?:sa_class|terate)|modify_filter|remove_filter|set(?:(?:_(?:a(?:l(?:ignment|loc_time)|ttr_(?:creation_order|phase_change))|btree_ratios|c(?:h(?:ar_encoding|unk(?:(?:_cache)?))|opy_object|reate_intermediate_group)|deflate|e(?:dc_check|xternal)|f(?:a(?:mily_offset|pl_(?:core|family|log|multi|s(?:ec2|plit|tdio)))|close_degree|il(?:l_(?:(?:tim|valu)e)|ter)|letcher32)|gc_references|hyper_vector_size|istore_k|l(?:ayout|i(?:bver_bounds|nk_(?:creation_order|phase_change)))|m(?:dc_config|(?:eta_block_siz|ulti_typ)e)|nbit|s(?:caleoffset|huffle|i(?:eve_buf_size|zes)|mall_data_block_size|ym_k)|userblock))?))|R\.(?:create|dereference|get_(?:name|obj_type|region))|S\.(?:c(?:lose|opy|reate(?:(?:_simple)?))|extent_copy|get_s(?:elect_(?:bounds|elem_(?:npoints|pointlist)|hyper_(?:blocklist|nblocks)|npoints|type)|imple_extent_(?:dims|n(?:(?:dim|point)s)|type))|is_simple|offset_simple|se(?:lect_(?:all|elements|hyperslab|none|valid)|t_extent_(?:(?:non|simpl)e)))|T\.(?:array_create|c(?:lose|o(?:mmit(?:(?:ted)?)|py)|reate)|detect_class|e(?:num_(?:create|insert|(?:nam|valu)eof)|qual)|get_(?:array_(?:(?:(?:n)?)dims)|c(?:lass|(?:reate_plis|se)t)|ebias|fields|inpad|member_(?:class|index|name|offset|(?:typ|valu)e)|n(?:ative_type|members|orm)|o(?:ffset|rder)|p(?:ad|recision)|s(?:i(?:gn|ze)|trpad|uper)|tag)|i(?:nsert|s_variable_str)|lock|open|pack|set_(?:cset|ebias|fields|inpad|norm|o(?:ffset|rder)|p(?:ad|recision)|s(?:i(?:gn|ze)|trpad)|tag)|vlen_create)|Z\.(?:filter_avail|get_filter_info))|Inf|KeyValue(?:(?:Datas|S)tore)|M(?:Exception(?:(?:\.last)?)|aximizeCommandWindow|emoizedFunction|inimizeCommandWindow)|N(?:ET(?:(?:\.(?:Assembly|GenericClass|NetException|addAssembly|c(?:onvertArray|reate(?:Array|Generic))|disableAutoRelease|enableAutoRelease|i(?:(?:nvokeGenericMetho|sNETSupporte)d)|setStaticProperty))?)|a(?:[NT]))|OperationResult|P(?:ut(?:CharArray|FullMatrix|WorkspaceData)|ythonEnvironment)|Quit|R(?:andStream|e(?:leaseCompatibility(?:Exception|Results)|move(?:(?:All)?)))|Setting(?:(?:sGroup)?)|T(?:allDatastore|est(?:(?:Result)?)|iff|ransformedDatastore)|V(?:alueIterator|ersionResults|ideo(?:(?:Read|Writ)er))|a(?:bs|c(?:cumarray|o(?:s(?:[dh])|t(?:[dh])|[st])|sc(?:(?:[dh])?)|tx(?:(?:GetRunningS|s)erver))|d(?:d(?:(?:C(?:ause|orrection)|F(?:ile|olderIncludingChildFiles)|Group|Label|Path|Reference|S(?:etting|h(?:ortcut|utdownFile)|t(?:(?:artupFi|y)le))|ToolbarExplorationButtons|boundary|cats|e(?:dge|vent)|listener|multi|node|p(?:ath|oints|r(?:ef|op))|sample(?:(?:tocollection)?)|t(?:odate|s)|vars)?)|jacency)|iry|l(?:i(?:gn|m)|l(?:(?:child)?)|pha(?:(?:S(?:hape|pectrum)|Triangulation|map|numeric(?:Boundary|sPattern))?))|md|n(?:alyzeCodeCompatibility|cestor|gle|imatedline|notation|[sy])|pp(?:designer|end)|r(?:ea|guments|ray(?:2t(?:(?:(?:imet)?)able)|Datastore|fun))|s(?:FewOfPattern|ManyOfPattern|cii|ec(?:(?:[dh])?)|in(?:(?:[dh])?)|s(?:ert|ignin))|tan(?:(?:2d|[2dh])?)|u(?:dio(?:dev(?:info|reset)|info|player|re(?:ad|corder)|write)|tumn)|x(?:es|is|toolbar(?:(?:btn)?)))|b(?:a(?:lance|ndwidth|r(?:(?:3h|ycentricToCartesian|[3h])?)|se2dec|tchStartupOptionUsed)|ctree|e(?:ep|nch|ssel(?:[hijky])|t(?:a(?:(?:inc(?:(?:inv)?)|ln)?)|ween))|fsearch|i(?:c(?:g(?:(?:stab(?:(?:l)?))?)|onncomp)|n(?:2dec|ary|scatter)|t(?:and|cmp|get|not|or|s(?:(?:e|hif)t)|xor))|l(?:anks|e(?:(?:list)?)|kdiag|uetooth(?:(?:list)?))|o(?:ne|und(?:ary(?:(?:Facets|shape)?)|ingbox|s)|x(?:(?:chart)?))|r(?:ighten|ush)|sxfun|u(?:bble(?:chart(?:(?:3)?)|l(?:egend|im)|size)|il(?:ddocsearchdb|tin))|vp(?:4c|5c|get|init|set|xtend))|c(?:a(?:l(?:d(?:ays|iff)|endar(?:(?:Duration)?)|llib|(?:month|quarter|week|year)s)|m(?:dolly|eratoolbar|l(?:(?:igh|ooka)t)|orbit|p(?:an|os|roj)|roll|target|up|va|zoom)|nUse(?:GPU|ParallelPool)|rt(?:2(?:pol|sph)|esianToBarycentric)|s(?:e(?:(?:Ins|S)ensitivePattern)|t)|t(?:(?:egori(?:cal|es))?)|xis)|d(?:(?:f(?:2rdf|epoch|info|lib|read))?)|e(?:il|ll(?:(?:2(?:mat|struct|table)|disp|fun|plot|str)?)|ntr(?:ality|oid))|gs|h(?:ar(?:(?:acter(?:ListPattern|istic))?)|eckcode|o(?:l(?:(?:update)?)|ose(?:(?:ContextMenu)?)))|irc(?:shift|umcenter)|l(?:a(?:bel|ss(?:(?:Underlying)?))|ear(?:(?:AllMemoizedCaches|PersonalValue|TemporaryValue|(?:point|var)s)?)|i(?:b(?:Array|ConvertArray|Is(?:Null|ReadOnly)|Release|gen\.(?:buildInterface|generateLibraryDefinition))|pboard)|o(?:ck|ne|se(?:(?:File|req)?))|[acf])|m(?:ap2gray|(?:permut|uniqu)e)|o(?:deCompatibilityReport|l(?:amd|lapse|o(?:n|r(?:bar|cube|map|order))|perm)|m(?:\.mathworks\.(?:engine\.MatlabEngine|matlab\.types\.(?:C(?:ellStr|omplex)|(?:HandleObje|Stru)ct))|bine|et(?:(?:3)?)|p(?:a(?:n|ss)|lex|ose|uter)|server)|n(?:de(?:ig|nsation|st)|eplot|figure(?:Callback|Terminator)|ncomp|t(?:ain(?:ers\.Map|s(?:(?:range)?))|our(?:(?:slice|[3cf])?)|rast)|v(?:e(?:rt(?:C(?:(?:harsToString|ontainedStringsToChar)s)|StringsToChars|To|vars)|xHull)|hull(?:(?:n)?)|[2n])|[djv])|ol|p(?:per|y(?:HDU|file|graphics|obj))|rrcoef|s(?:pi|[dh])|t(?:[dh])|unt(?:(?:cats)?)|[stv])|p(?:lxpair|utime)|r(?:eate(?:Category|File|Img|(?:Labe|Tb)l)|iticalAlpha|oss)|sc(?:(?:[dh])?)|transpose|u(?:m(?:m(?:ax|in)|prod|sum|trapz)|r(?:l|rentProject))|ylinder)|d(?:a(?:spect|t(?:a(?:Tip(?:Interaction|TextRow)|cursormode|store|tip)|e(?:(?:num|s(?:hift|tr)|ti(?:ck|me)|vec)?))|y(?:(?:s)?))|b(?:c(?:lear|ont)|down|mex|quit|st(?:a(?:ck|tus)|(?:[eo])p)|type|up)|de(?:23|get|nsd|s(?:d|et))|e(?:blank|c(?:2(?:b(?:ase|in)|hex)|ic|o(?:mposition|nv))|g(?:2rad|ree)|l(?:2|aunay(?:(?:(?:(?:Triangulatio)?)n)?)|e(?:te(?:(?:Col|File|HDU|Key|R(?:ecord|ows))?)|vent)|imitedTextImportOptions|sample(?:(?:fromcollection)?))|mo|scriptor|t(?:(?:ails|ectImportOptions|rend)?)|val)|fsearch|i(?:a(?:g|log|ry)|ff(?:(?:use)?)|g(?:it(?:Boundary|sPattern)|raph)|r|s(?:ableDefaultInteractivity|cretize|p(?:(?:lay)?)|sect|tances)|ther|vergence)|mperm|o(?:csearch|uble|[cst])|ra(?:g(?:(?:rect)?)|wnow)|searchn|uration|ynamicprops)|e(?:cho(?:(?:demo|tcpip)?)|d(?:ge(?:Attachments|count|s)|it)|ig(?:(?:s)?)|llip(?:j|ke|soid)|mpty|n(?:able(?:DefaultInteractivity|LegacyExplorationModes|(?:NETfromNetworkDriv|servic)e)|dsWith|umeration)|omday|ps|q(?:(?:uilibrate)?)|r(?:ase(?:(?:Between)?)|f(?:(?:c(?:(?:inv|x)?)|inv)?)|ror(?:(?:bar|dlg)?))|t(?:ime|ree(?:(?:plot)?))|v(?:al(?:(?:c|in)?)|ent(?:\.(?:ClassInstanceEvent|DynamicPropertyEvent|EventData|PropertyEvent|(?:hasL|(?:(?:prop)?)l)istener)|(?:(?:listener)?)s))|x(?:celtime|i(?:(?:(?:s)?)t)|p(?:(?:and|int|m(?:(?:1)?)|ort(?:(?:2wsdlg|app|graphics|setupdlg)?))?)|tract(?:(?:After|Be(?:fore|tween))?))|ye|zpolar)|f(?:a(?:c(?:eNormal|tor(?:(?:ial)?))|lse)|c(?:lose|ontour)|e(?:at(?:her|ureEdges)|of|rror|val|werbins)|ft(?:(?:shift|[2nw])?)|get(?:[ls])|i(?:eldnames|gure(?:(?:palette)?)|l(?:e(?:Datastore|Mode|Name|attrib|marker|parts|read|sep)|l(?:(?:3|missing|outliers)?)|ter(?:(?:2)?))|mplicit(?:(?:3)?)|n(?:d(?:(?:Category|Event|File|Label|all|edge|figs|groups|node|obj|prop)?)|ish)|ts(?:disp|info|read|write)|x(?:(?:edWidthImportOptions)?))|l(?:ag|i(?:ntmax|p(?:(?:edge|lr|ud)?))|o(?:or|w)|ush)|m(?:esh|in(?:bnd|search))|o(?:pen|rmat)|p(?:lot(?:(?:3)?)|rintf)|r(?:ame2im|e(?:ad|eBoundary|qspace|wind))|s(?:canf|eek|urf)|t(?:ell|p)|u(?:ll(?:(?:file)?)|n(?:c(?:2str|tion(?:_handle|(?:(?:test)?)s))|m))|write|zero)|g(?:a(?:llery|mma(?:(?:inc(?:(?:inv)?)|ln)?)|ther)|c(?:b(?:[fo])|mr|[adfo])|e(?:npath|o(?:axes|b(?:asemap|ubble)|densityplot|limits|plot|scatter|tickformat)|t(?:(?:A(?:(?:ColParm|xe)s)|BColParms|Co(?:l(?:Name|Type|orbar)|nstantValue)|EqColType|FileFormats|H(?:DU(?:num|type)|drSpace)|Img(?:(?:Siz|Typ)e)|L(?:ayout|egend)|MockHistory|Num(?:Cols|HDUs|Inputs(?:(?:Impl)?)|Outputs(?:(?:Impl)?)|Rows)|OpenFiles|Pro(?:files|pertyGroupsImpl)|Report|TimeStr|Version|a(?:bstime|(?:pp|udio)data)|datasamples(?:(?:ize)?)|env|f(?:ield|rame)|interpmethod|next|p(?:i(?:nstatus|xelposition)|layer|oints|ref)|qualitydesc|rangefromclass|sample(?:s|usingtime)|t(?:imeseriesnames|s(?:a(?:(?:fter(?:(?:at)?)|t)event)|be(?:fore(?:(?:(?:at)?)event)|tweenevents)))|varopts)?))|input|mres|objects|plot|r(?:a(?:bcode|dient|ph|y)|id(?:(?:d(?:ata(?:(?:n)?)|edInterpolant))?)|o(?:ot|up(?:counts|filter|summary|transform)))|svd|text|u(?:i(?:d(?:ata|e)|handles)|nzip)|zip)|h(?:5(?:create|disp|info|read(?:(?:att)?)|write(?:(?:att)?))|a(?:damard|n(?:dle|kel)|s(?:F(?:(?:actoryValu|ram)e)|Group|PersonalValue|Setting|TemporaryValue|data|next))|df(?:an|df(?:24|r8)|h(?:[dex])|info|ml|pt|read|v(?:[fhs])|[hv])|e(?:a(?:d|tmap)|ight|lp(?:(?:dlg)?)|ss|x2(?:dec|num))|g(?:export|group|transform)|i(?:dden|ghlight|lb|st(?:counts(?:(?:2)?)|ogram(?:(?:2)?)))|ms|o(?:l(?:d|es)|me|rzcat|t|ur(?:(?:s)?)|ver)|sv(?:(?:2rgb)?)|ypot)|i(?:chol|d(?:ealfilter|ivide)|fft(?:(?:shift|[2n])?)|lu|m(?:2(?:double|frame|gray|java)|a(?:g(?:(?:e(?:(?:Datastore|sc)?))?)|pprox)|f(?:info|ormats)|gCompress|port(?:(?:data)?)|re(?:ad|size)|show|(?:til|writ)e)|n(?:Shape|c(?:enter|idence)|d(?:2(?:(?:rg|su)b)|egree)|edges|foImpl|mem|ner(?:2outer|join)|p(?:olygon|ut(?:(?:Parser|dlg|name)?))|sert(?:A(?:Tbl|fter)|B(?:Tbl|efore)|Col|Img|Rows)|t(?:16|2str|32|64|8|e(?:gral(?:(?:[23])?)|r(?:p(?:ft|streamspeed|[123n])|sect))|m(?:ax|in))|v(?:(?:hilb)?))|permute|qr|s(?:Co(?:mpressedImg|nnected)|D(?:iscreteStateSpecificationMutableImpl|one(?:(?:Impl)?))|In(?:activePropertyImpl|put(?:(?:Complexity|(?:DataTyp|Siz)e)MutableImpl)|terior)|Key|Lo(?:(?:ad|ck)ed)|MATLABReleaseOlderThan|Partitionable|S(?:huffleable|tringScalar)|TunablePropertyDataTypeMutableImpl|UnderlyingType|a(?:(?:Underlying|ppdata)?)|b(?:anded|etween)|c(?:a(?:lendarduration|tegor(?:ical|y))|ell(?:(?:str)?)|ha(?:nge|r)|o(?:lumn|m))|d(?:a(?:g|tetime)|iag|st|uration)|e(?:mpty|num|qual(?:(?:n)?)|vent)|f(?:i(?:eld|(?:l|nit)e)|loat|older)|graphics|h(?:andle|ermitian|ol(?:[de]))|i(?:n(?:f|te(?:ger|r(?:face|ior)))|somorphic)|java|keyword|l(?:etter|o(?:calm(?:ax|in)|gical))|m(?:a(?:c|trix)|e(?:mber(?:(?:tol)?)|thod)|issing|ultigraph)|n(?:a(?:[nt])|umeric)|o(?:bject|c(?:(?:ap|olor)s)|morphism|normals|rdinal|surface|utlier)|p(?:c|laying|r(?:ef|ime|o(?:p|tected)))|r(?:e(?:al|cording|gular)|ow)|s(?:calar|implified|orted(?:(?:rows)?)|pa(?:(?:c|rs)e)|t(?:r(?:ing|prop|uct)|udent)|ymmetric)|t(?:a(?:ble|ll)|imetable|ri(?:[lu]))|un(?:defined|ix)|v(?:a(?:lid|rname)|ector)|weekend))|j(?:ava(?:Array|Method(?:(?:EDT)?)|Object(?:(?:EDT)?)|addpath|c(?:hk|lasspath)|rmpath)|et|oin|(?:son(?:(?:de|en)cod)|uliandat)e)|k(?:ey(?:board|s)|ron)|l(?:a(?:bel(?:(?:edg|nod)e)|g|placian|stwarn|yout)|cm|dl|e(?:apseconds|gend(?:(?:re)?)|ngth|tter(?:Boundary|sPattern))|i(?:b(?:\.pointer|functions(?:(?:view)?)|isloaded|pointer|struct)|cense|ght(?:(?:angle|ing)?)|n(?:2mu|e(?:(?:Boundary|s)?)|k(?:axes|data|prop)|s(?:(?:olv|pac)e))|st(?:ModifiedFiles|RequiredFiles|dlg|ener|fonts))|o(?:ad(?:(?:ObjectImpl|library|obj)?)|calfunctions|g(?:(?:1(?:[0p])|ical|log|space|[2m])?)|ok(?:AheadBoundary|BehindBoundary|for)|wer)|s(?:cov|q(?:minnorm|nonneg|r))|[su])|m(?:a(?:gic|k(?:ehgtform|ima)|preduce(?:(?:r)?)|skedPattern|t(?:2(?:cell|str)|ch(?:(?:e|pair)s)|erial|file|lab(?:\.(?:System|a(?:ddons\.(?:disableAddon|enableAddon|i(?:nstall(?:(?:edAddons)?)|sAddonEnabled)|toolbox\.(?:install(?:Toolbox|edToolboxes)|packageToolbox|toolboxVersion|uninstallToolbox)|uninstall)|pputil\.(?:create|getInstalledAppInfo|install|package|run|uninstall))|codetools\.requiredFilesAndProducts|e(?:ngine\.(?:FutureResult|MatlabEngine|connect_matlab|engineName|find_matlab|isEngineShared|s(?:hareEngine|tart_matlab))|xception\.(?:(?:Java|Py)Exception))|graphics\.chartcontainer\.(?:ChartContainer|mixin\.(?:Colorbar|Legend))|io\.(?:Datastore|datastore\.(?:BlockedFileSet|DsFile(?:Reader|Set)|F(?:ile(?:Set|Writable)|oldersPropertyProvider)|HadoopLocationBased|(?:Partition|Shuffle)able)|hdf(?:4\.sd|eos\.(?:gd|sw))|saveVariablesToScript)|lang\.(?:OnOffSwitchState|correction\.(?:(?:AppendArguments|ConvertToFunctionNotation|ReplaceIdentifier)Correction)|make(?:UniqueStrings|ValidName))|m(?:ex\.MexHost|ixin\.(?:C(?:opyable|ustomDisplay)|Heterogeneous|SetGet(?:(?:ExactNames)?)|util\.PropertyGroup)|ock\.(?:AnyArguments|InteractionHistory(?:(?:\.forMock)?)|MethodCallBehavior|Property(?:(?:(?:(?:[GS])et)?)Behavior)|TestCase|actions\.(?:AssignOutputs|DoNothing|Invoke|ReturnStoredValue|StoreValue|ThrowException)|constraints\.(?:Occurred|Was(?:Accessed|Called|Set))))|net\.(?:ArrayFormat|QueryParameter|URI|base64(?:(?:de|en)code)|http\.(?:Auth(?:Info|enticationScheme)|C(?:ookie(?:(?:Info)?)|redentials)|Disposition|H(?:TTP(?:Exception|Options)|eaderField)|LogRecord|Me(?:diaType|ssage(?:(?:Body|Type)?))|Pro(?:gressMonitor|tocolVersion)|Re(?:quest(?:Line|Me(?:ssage|thod))|sponseMessage)|Sta(?:rtLine|tus(?:C(?:lass|ode)|Line))|field\.(?:(?:A(?:ccept|uth(?:enticat(?:e|ionInfo)|orization))|Co(?:ntent(?:Disposition|L(?:ength|ocation)|Type)|okie)|Date|Generic(?:(?:Parameterized)?)|HTTPDate|Integer|Location|(?:MediaRang|SetCooki|URIReferenc)e)Field)|io\.(?:(?:BinaryConsum|Content(?:Consum|Provid)|F(?:ile(?:Consum|Provid)|ormProvid)|Generic(?:Consum|Provid)|Image(?:Consum|Provid)|JSON(?:Consum|Provid)|Multipart(?:Consum|(?:(?:Form)?)Provid)|String(?:Consum|Provid))er)))|p(?:erftest\.(?:F(?:(?:ixed|requentist)TimeExperiment)|T(?:estCase|ime(?:(?:Experimen|Resul)t)))|roject\.(?:Project|c(?:onvertDefinitionFiles|reateProject)|(?:delete|load|root)Project))|s(?:ettings\.(?:FactoryGroup\.createToolboxGroup|SettingsFileUpgrader|loadSettingsCompatibilityResults|mustBe(?:(?:Integer|Logical|Numeric|String)Scalar)|reloadFactoryFile)|ystem\.mixin\.FiniteSource)|t(?:all\.(?:blockMovingWindow|movingWindow|reduce|transform)|est\.behavior\.Missing)|u(?:i(?:\.componentcontainer\.ComponentContainer|test\.(?:TestCase(?:(?:\.forInteractiveUse)?)|unlock))|nittest\.(?:Test(?:(?:Case|R(?:esult|unner)|Suite)?)|constraints\.(?:BooleanConstraint|Constraint|Tolerance)|diagnostics\.(?:(?:(?:Constraint)?)Diagnostic)|fixtures\.Fixture|measurement\.(?:(?:DefaultMeasurementResul|MeasurementResul|chart\.ComparisonPlo)t)|plugins\.(?:OutputStream|Parallelizable|(?:Qualifying|TestRunner)Plugin)))|wsdl\.(?:createWSDLClient|setWSDLToolPath))|Release|r(?:c|oot)))|x(?:(?:flow|k)?))|e(?:an|dian|m(?:mapfile|o(?:ize|ry))|rge(?:(?:cat|var)s)|sh(?:(?:grid|[cz])?)|t(?:a(?:\.(?:ArrayDimension|DynamicProperty|EnumeratedValue|FixedDimension|MetaData|UnrestrictedDimension|Validation|abstractDetails|class(?:(?:\.fromName)?)|event|method|p(?:ackage(?:(?:\.(?:fromName|getAllPackages))?)|roperty))|class)|hods(?:(?:view)?))|x(?:(?:(?:ex|hos)t)?))|filename|get|i(?:lliseconds|n(?:(?:k|res|spantree|ute(?:(?:s)?))?)|s(?:locked|sing))|k(?:dir|pp)|l(?:divide|intrpt|ock)|mfileinfo|o(?:d(?:(?:e)?)|nth|re(?:(?:bins)?)|v(?:AbsHDU|NamHDU|RelHDU|e(?:(?:file|gui|vars)?)|ie|m(?:a(?:[dx])|(?:e(?:(?:(?:di)?)a)|i)n)|prod|s(?:td|um)|var))|p(?:ower|ut)|rdivide|sgbox|times|u(?:2lin|ltiband(?:read|write)|nlock|stBe(?:A|F(?:i(?:(?:l|nit)e)|loat|older)|GreaterThan(?:(?:OrEqual)?)|In(?:Range|teger)|LessThan(?:(?:OrEqual)?)|Member|N(?:egative|on(?:Nan|empty|missing|negative|positive|sparse|zero(?:(?:LengthText)?))|umeric(?:(?:OrLogical)?))|Positive|Real|ScalarOrEmpty|Text(?:(?:Scalar)?)|UnderlyingType|V(?:alidVariableName|ector))))|n(?:a(?:me(?:d(?:Pattern|args2cell)|lengthmax)|rg(?:in(?:(?:chk)?)|out(?:(?:chk)?))|tive2unicode)|c(?:create|disp|hoosek|info|read(?:(?:att)?)|write(?:(?:att|schema)?))|d(?:grid|ims)|e(?:arest(?:(?:Neighbor|vertex)?)|ighbors|tcdf\.(?:abort|c(?:lose|opyAtt|reate)|de(?:f(?:Dim|Grp|Var(?:(?:Chunking|Deflate|F(?:ill|letcher32))?))|lAtt)|endDef|get(?:Att|C(?:hunkCache|onstant(?:(?:Names)?))|Var)|inq(?:(?:Att(?:(?:ID|Name)?)|Dim(?:(?:ID(?:(?:s)?))?)|Format|Grp(?:Name(?:(?:Full)?)|Parent|s)|LibVers|Ncid|UnlimDims|Var(?:(?:Chunking|Deflate|F(?:ill|letcher32)|ID(?:(?:s)?))?))?)|open|put(?:Att|Var)|re(?:Def|name(?:Att|Dim|Var))|s(?:et(?:ChunkCache|DefaultFormat|Fill)|ync))|w(?:line|plot)|xt(?:pow2|tile))|nz|o(?:nzeros|rm(?:(?:alize|est)?)|tify|w)|sidedpoly|throot|u(?:fft(?:(?:n)?)|ll|m(?:2(?:cell|hex|(?:rule|st)r)|ArgumentsFromSubscript|Regions|boundaries|e(?:dges|l)|(?:node|partition|side)s))|zmax)|o(?:de(?:1(?:13|5(?:[is]))|23(?:(?:tb|[st])?)|45|get|set|xtend)|n(?:Cleanup|es)|p(?:en(?:(?:DiskFile|File|Project|fig|gl|var)?)|ti(?:m(?:(?:[gs])et)|onalPattern))|r(?:d(?:e(?:ig|rfields)|qz|schur)|ient|th)|ut(?:degree|e(?:dges|rjoin))|verlaps(?:(?:range)?))|p(?:a(?:ck|decoef|ge(?:ctranspose|mtimes|transpose)|nInteraction|r(?:allelplot|eto|quet(?:Datastore|info|read|write)|tition|ula)|scal|t(?:ch|h(?:(?:sep|tool)?)|tern)|use|[dn])|baspect|c(?:g|hip|o(?:de|lor))|de(?:pe|val)|e(?:aks|r(?:imeter|l|m(?:s|ute)))|i(?:(?:e(?:(?:3)?)|n(?:[kv]))?)|l(?:a(?:nerot|y(?:(?:blocking)?))|ot(?:(?:3|browser|edit|matrix|tools)?)|us)|o(?:intLocation|l(?:2cart|ar(?:axes|bubblechart|histogram|plot|scatter)|y(?:(?:area|buffer|der|eig|fit|int|shape|val(?:(?:m)?))?))|s(?:ixtime|sessivePattern)|w2)|pval|r(?:e(?:decessors|f(?:dir|erences)|ss|view)|i(?:mes|nt(?:(?:dlg|opt|preview)?)|sm)|o(?:cess(?:(?:InputSpecificationChange|TunedProperties)Impl)|d|file|pe(?:dit|rt(?:ies|yeditor))))|si|ublish|wd|y(?:args|env))|q(?:mr|r(?:delete|insert|update)|u(?:a(?:d(?:2d|gk)|rter)|estdlg|i(?:t|ver(?:(?:3)?)))|[rz])|r(?:a(?:d2deg|n(?:d(?:perm|[in])|[dk])|t(?:(?:s)?))|bbox|cond|e(?:a(?:d(?:ATblHdr|BTblHdr|C(?:ard|ol)|Frame|Img|Key(?:(?:Cmplx|Dbl|Long(?:Long|Str)|Unit)?)|Record|all|cell|line(?:(?:s)?)|matrix|struct|t(?:(?:(?:imet)?)able)|vars)|l(?:log|m(?:ax|in)|pow|sqrt)|[dl])|c(?:ord(?:(?:blocking)?)|t(?:angle|int)|ycle)|duce(?:patch|volume)|fresh(?:(?:SourceControl|data)?)|g(?:exp(?:(?:Pattern|i|rep|translate)?)|i(?:on(?:ZoomInteraction|s)|sterevent)|matlabserver)|hash|l(?:ationaloperators|ease(?:(?:Impl)?)|oad)|m(?:(?:ove(?:(?:Category|File|Group|Label|Path|Reference|S(?:etting|h(?:ortcut|utdownFile)|t(?:(?:artupFi|y)le))|(?:ToolbarExplorationButton|cat|t|var)s)?))?)|n(?:ame(?:(?:(?:cat|var)s)?)|dererinfo)|order(?:(?:cat|node)s)|p(?:elem|lace(?:(?:Between)?)|mat)|s(?:ample|cale|et(?:(?:Impl)?)|hape|idue|toredefaultpath|ume)|t(?:hrow|ime)|verse)|gb(?:2(?:gray|hsv|ind)|plot)|ibbon|lim|m(?:appdata|boundary|dir|edge|field|holes|missing|node|outliers|p(?:ath|r(?:ef|op))|slivers)|ng|o(?:ots|sser|t(?:90|ate(?:(?:3d|Interaction)?))|und|w(?:fun|s2vars))|ref|sf2csf|tick(?:angle|format|(?:(?:label)?)s)|u(?:ler(?:2num|PanInteraction)|n(?:(?:Checks|perf|tests)?)))|s(?:ave(?:(?:ObjectImpl|as|fig|obj|path)?)|c(?:a(?:le|tter(?:(?:3|edInterpolant|histogram)?))|hur|roll)|e(?:c(?:ond(?:(?:s)?)|[dh])|milog(?:[xy])|ndmail|rialport(?:(?:list)?)|t(?:Bscale|CompressionType|DTR|HCompS(?:cale|mooth)|Properties|RTS|T(?:ileDim|scale)|a(?:bstime|ppdata)|cats|diff|env|field|interpmethod|p(?:ixelposition|ref)|ti(?:(?:meseriesname|ng)s)|u(?:niformtime|p(?:(?:Impl)?))|var(?:opts|type)|xor)|[ct])|gtitle|h(?:ading|eetnames|g|iftdim|o(?:rtestpath(?:(?:tree)?)|wplottool)|rinkfaces|uffle)|i(?:gn|mplify|n(?:(?:gle|pi|[dh])?)|ze)|lice|mooth(?:3|data)|napnow|o(?:rt(?:(?:boundaries|r(?:(?:egion|ow)s)|[xy])?)|und(?:(?:sc)?))|p(?:a(?:lloc|rse|ugment)|convert|diags|e(?:cular|ye)|fun|h(?:2cart|ere)|inmap|li(?:ne|t(?:(?:apply|(?:line|var)s)?))|ones|parms|r(?:an(?:d(?:n|sym)|[dk])|eadsheet(?:Datastore|ImportOptions)|in(?:g|tf))|y)|q(?:rt(?:(?:m)?)|ueeze)|s(?:(?:2t|can)f)|t(?:a(?:ck(?:(?:edplot)?)|irs|ndardizeMissing|rt(?:(?:at|sWith|up)?))|d|e(?:m3|pImpl|[mp])|l(?:read|write)|op|r(?:2(?:double|func|num)|c(?:at|mp(?:(?:i)?))|eam(?:line|particles|ribbon|(?:slic|tub)e|[23])|find|i(?:ng(?:(?:s)?)|p)|j(?:oin|ust)|length|ncmp(?:(?:i)?)|rep|split|t(?:ok|rim)|uct(?:(?:2(?:cell|table)|fun)?)))|u(?:b(?:2ind|graph|plot|s(?:asgn|cribe|index|pace|ref|truct)|t(?:itle|ract)|volume)|ccessors|m(?:(?:m(?:ary|er))?)|perclasses|rf(?:(?:2patch|ace(?:(?:Area)?)|norm|[cl])?))|vd(?:(?:s(?:(?:ketch)?))?)|wa(?:pbytes|rmchart(?:(?:3)?))|y(?:lvester|m(?:amd|bfact|mlq|rcm)|nchronize|s(?:objupdate|tem)))|t(?:a(?:b(?:le(?:(?:2(?:array|cell|struct|timetable))?)|ularTextDatastore)|il|ll(?:(?:rng)?)|n(?:[dh])|[nr])|cpclient|e(?:mp(?:dir|name)|stsuite|tramesh|x(?:label|t(?:(?:Boundary|scan|wrap)?)))|fqmr|h(?:eta(?:lim|tick(?:format|(?:(?:label)?)s))|ingSpeak(?:Read|Write)|row(?:(?:AsCaller)?))|i(?:c|ledlayout|me(?:(?:it|ofday|r(?:(?:ange|find(?:(?:all)?))?)|series|table(?:(?:2table)?)|zones)?)|tle)|o(?:c|datenum|eplitz|olboxdir|p(?:krows|osort))|r(?:a(?:ce|ns(?:closure|form|late|pose|reduction)|pz)|ee(?:(?:layou|plo)t)|i(?:angulation|mesh|plot|surf|[lu])|ue)|s(?:collection|data\.event|earchn)|ur(?:bo|ningdist)|ype(?:(?:cast)?)|zoffset)|u(?:i(?:a(?:lert|xes)|button(?:(?:group)?)|c(?:heckbox|on(?:firm|t(?:extmenu|rol)))|d(?:atepicker|ropdown)|editfield|figure|g(?:auge|et(?:dir|file|pref)|ridlayout)|html|image|knob|l(?:a(?:bel|mp)|istbox)|menu|nt(?:16|32|64|8)|open|p(?:anel|rogressdlg|u(?:shtool|tfile))|r(?:adiobutton|esume)|s(?:ave|et(?:color|font|pref)|lider|pinner|t(?:ack|yle)|witch)|t(?:ab(?:(?:group|le)?)|extarea|o(?:ggle(?:button|tool)|olbar)|ree(?:(?:node)?))|wait)|minus|n(?:derlying(?:(?:Typ|Valu)e)|i(?:code2native|on|que(?:(?:tol)?)|x)|loadlibrary|m(?:esh|kpp)|register(?:allevents|event)|s(?:tack|ubscribe)|tar|(?:wra|zi)p)|p(?:date(?:(?:Dependencies)?)|lus|per)|se(?:java|rpath))|v(?:a(?:l(?:idate(?:FunctionSignaturesJSON|InputsImpl|PropertiesImpl|attributes|color|string)|ues)|nder|r(?:(?:arg(?:in|out)|fun|type)?))|e(?:cnorm|r(?:(?:LessThan|sion|t(?:cat|ex(?:Attachments|Normal)))?))|i(?:ew(?:(?:mtx)?)|sdiff)|o(?:lume(?:(?:bounds)?)|ronoi(?:(?:Diagram|n)?)))|w(?:a(?:it(?:(?:bar|for(?:(?:buttonpress)?))?)|rn(?:(?:dl|in)g)|terfall)|e(?:b(?:(?:options|read|(?:sav|writ)e)?)|ek(?:(?:day)?))|h(?:at|i(?:ch|tespace(?:Boundary|Pattern))|o(?:(?:s)?))|i(?:dth|l(?:(?:dcardPatter|kinso)n)|n(?:open|queryreg|ter)|th(?:inrange|tol))|ordcloud|rite(?:(?:C(?:hecksum|o(?:l|mment))|Date|History|Img|Key(?:(?:Unit)?)|Video|all|cell|line|matrix|struct|t(?:(?:(?:imet)?)able))?))|x(?:co(?:rr|v)|l(?:abel|i(?:m|ne))|ml(?:read|write)|or|slt|tick(?:angle|format|(?:(?:label)?)s))|y(?:ear(?:(?:s)?)|l(?:abel|i(?:m|ne))|md|tick(?:angle|format|(?:(?:label)?)s)|y(?:axis|yymmdd))|z(?:eros|ip|l(?:abel|im)|oom(?:(?:Interaction)?)|tick(?:angle|format|(?:(?:label)?)s))|[ij]))\b"

    Is the second one too outlandish? Is there a way we can test performance? Although personally, I wouldn't mind slightly slower syntax highlighting if the result is better enough.

  4. The terms were previously held in tuples. They are now in lists, which makes more sense in my head but doesn't matter one bit in practice here (probably?).

  5. Please note that I don't currently and never really made significant use of Matlab. That also means I can't really test this "in the wild" right now, although existing code snippets should be enough.

Let me know what you think.

@alexpovel
Copy link
Contributor Author

Just removed the auto-formatting with black and just left my actual changes. The diffs were super hard to read otherwise.

@Anteru Anteru self-assigned this Feb 14, 2021
@Anteru Anteru added this to the 2.8 milestone Feb 14, 2021
@Anteru Anteru added the changelog-update Items which need to get mentioned in the changelog label Feb 14, 2021
@Anteru Anteru merged commit 3c06350 into pygments:master Feb 14, 2021
@Anteru
Copy link
Collaborator

Anteru commented Feb 14, 2021

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants