mirror of
https://github.com/cheat/cheat.git
synced 2024-11-23 22:41:35 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
101 lines
13 KiB
XML
101 lines
13 KiB
XML
<lexer>
|
|
<config>
|
|
<name>Octave</name>
|
|
<alias>octave</alias>
|
|
<filename>*.m</filename>
|
|
<mime_type>text/octave</mime_type>
|
|
</config>
|
|
<rules>
|
|
<state name="root">
|
|
<rule pattern="[%#].*$">
|
|
<token type="Comment"/>
|
|
</rule>
|
|
<rule pattern="^\s*function">
|
|
<token type="Keyword"/>
|
|
<push state="deffunc"/>
|
|
</rule>
|
|
<rule pattern="(unwind_protect_cleanup|end_unwind_protect|unwind_protect|end_try_catch|endproperties|endclassdef|endfunction|persistent|properties|endmethods|otherwise|endevents|endswitch|__FILE__|continue|classdef|__LINE__|endwhile|function|methods|elseif|return|static|events|global|endfor|switch|until|endif|while|catch|break|case|else|set|end|try|for|get|do|if)\b">
|
|
<token type="Keyword"/>
|
|
</rule>
|
|
<rule pattern="(history_timestamp_format_string|suppress_verbose_help_message|is_rooted_relative_filename|chisquare_test_independence|available_graphics_toolkits|print_struct_array_contents|re_read_readline_init_file|ignore_function_time_stamp|chisquare_test_homogeneity|sigterm_dumps_octave_core|save_header_format_string|sighup_dumps_octave_core|octave_core_file_options|confirm_recursive_rmdir|crash_dumps_octave_core|program_invocation_name|read_readline_init_file|echo_executing_commands|kolmogorov_smirnov_test|page_output_immediately|completion_append_char|output_max_field_width|kolmogorov_smirnov_cdf|print_empty_dimensions|octave_core_file_limit|struct_levels_to_print|make_absolute_filename|octave_core_file_name|default_save_options|isequalwithequalnans|is_absolute_filename|max_recursion_depth|native_float_format|kruskal_wallis_test|undo_string_escapes|commutation_matrix|fixed_point_format|debug_on_interrupt|completion_matches|duplication_matrix|sparse_auto_mutate|waitforbuttonpress|restoredefaultpath|is_duplicate_entry|page_screen_output|octave_config_info|do_string_escapes|f_test_regression|t_test_regression|command_line_path|debug_on_warning|is_valid_file_id|string_fill_char|find_dir_in_path|graphics_toolkit|mouse_wheel_zoom|file_in_loadpath|compare_versions|sylvester_matrix|silent_functions|output_precision|makeinfo_program|whos_line_format|split_long_rows|history_control|regexptranslate|validatestring|debug_on_error|hotelling_test|save_precision|gnuplot_binary|doc_cache_file|autoreg_matrix|saving_history|durbinlevinson|stdnormal_pdf|beep_on_error|bartlett_test|empirical_inv|wilcoxon_test|empirical_cdf|stdnormal_cdf|namelengthmax|daspk_options|lsode_options|empirical_pdf|empirical_rnd|dasrt_options|dassl_options|stdnormal_inv|stdnormal_rnd|discrete_rnd|logistic_cdf|discrete_cdf|logistic_inv|program_name|logistic_pdf|is_leap_year|spectral_adf|logistic_rnd|rectangle_sw|quad_options|mcnemar_test|file_in_path|info_program|rectangle_lw|spectral_xdf|tilde_expand|history_file|history_size|discrete_inv|discrete_pdf|laplace_cdf|refreshdata|common_size|dellistener|ishermitian|mahalanobis|print_usage|laplace_inv|parseparams|triangle_lw|laplace_rnd|triangle_sw|addproperty|semilogyerr|matrix_type|addlistener|orderfields|issymmetric|list_primes|isdebugmode|laplace_pdf|semilogxerr|periodogram|ezcontourf|fileattrib|freqz_plot|polyreduce|treelayout|inferiorto|size_equal|genvarname|onenormest|svd_driver|divergence|filemarker|fieldnames|cholupdate|cholinsert|choldelete|cellslices|errno_list|triplequad|ls_command|accumarray|cauchy_cdf|yulewalker|plotmatrix|polyaffine|cauchy_inv|studentize|ctranspose|nargoutchk|ishghandle|isdefinite|matlabroot|cauchy_rnd|cauchy_pdf|statistics|welch_test|superiorto|iscomplex|run_count|sprandsym|circshift|mfilename|fileparts|intersect|inputname|factorial|inpolygon|wilkinson|ifftshift|structfun|lsqnonneg|arch_test|addtodate|substruct|localtime|yes_or_no|vectorize|cholshift|lasterror|polyderiv|transpose|fractdiff|mislocked|playaudio|isvarname|delaunayn|convhulln|loglogerr|getrusage|griddatan|saveaudio|swapbytes|isnumeric|synthesis|functions|ellipsoid|subsindex|pqpnonneg|shell_cmd|sign_test|islogical|isstrprop|isinteger|info_file|regexprep|spconvert|spaugment|etreeplot|loadaudio|iscellstr|ezcontour|shiftdim|isglobal|readlink|treeplot|ishandle|sombrero|repelems|ismethod|fullfile|isargout|sortrows|ipermute|skewness|endgrent|errorbar|endpwent|polyvalm|sinewave|setfield|powerset|dbstatus|setgrent|sinetone|ismatrix|gui_mode|kurtosis|setaudio|toeplitz|spearman|textscan|textread|tempname|getgrent|issparse|semilogy|getgrgid|getgrnam|getpwent|optimset|strftime|optimget|semilogx|isvector|getfield|strptime|getpwnam|dsearchn|setpwent|specular|savepath|dlmwrite|subsasgn|gradient|symbfact|planerot|allchild|griddata|getpwuid|typecast|linkprop|urlwrite|runtests|diffpara|isobject|issorted|isstruct|keyboard|delaunay|typeinfo|run_test|datetick|surfnorm|strncmpi|nonzeros|lastwarn|cylinder|bincoeff|cumtrapz|hadamard|randperm|csvwrite|cplxpair|untabify|warranty|realsqrt|polyarea|gammainc|logspace|cor_test|corrcoef|issquare|copyfile|isscalar|convhull|var_test|poisscdf|accumdim|contrast|contourf|contourc|linspace|ismember|ancestor|nchoosek|arch_fit|arch_rnd|legendre|computer|arma_rnd|arrayfun|subspace|isfinite|luupdate|qrupdate|tsearchn|strtrunc|isletter|colormap|poissinv|qrinsert|colorbar|voronoin|poisspdf|mrdivide|interpft|closereq|poissrnd|strsplit|wavwrite|bicgstab|mldivide|bitshift|isxdigit|autoload|strmatch|assignin|movefile|celldisp|fftshift|blackman|meshgrid|rundemos|argnames|qrdelete|brighten|calendar|isfigure|bartlett|spparms|spstats|weekday|blkdiag|sprandn|binornd|binopdf|binoinv|binocdf|bicubic|betarnd|betapdf|wavread|betainv|cloglog|betacdf|whitebg|wienrnd|nargchk|colperm|voronoi|nbincdf|nbininv|nbinpdf|asctime|compass|nbinrnd|version|condest|contour|balance|besselh|besseli|besselj|besselk|bessely|lookfor|bitpack|newplot|builtin|ccolamd|cellfun|lognrnd|warning|waitpid|lognpdf|logninv|cstrcat|csvread|vertcat|logncdf|spinmap|unifrnd|unifpdf|cholinv|interpn|datenum|datestr|normcdf|datevec|dblquad|unifinv|deblank|normest|norminv|toupper|normpdf|unifcdf|detrend|tmpfile|diffuse|unidrnd|normrnd|nthroot|symlink|spencer|display|subsref|strvcat|unidpdf|dsearch|strncmp|strcmpi|squeeze|sprintf|dbclear|sizemax|spdiags|dbstack|pathdef|rmfield|unidinv|rethrow|example|reshape|dbwhere|unidcdf|realmin|realmax|readdir|rdivide|loadobj|ezmeshc|dlmread|ezpolar|permute|ezsurfc|pathsep|nfields|nargout|munlock|feather|fftconv|fftfilt|mkstemp|license|shading|methods|qrshift|findall|findobj|findstr|trisurf|triplot|flipdim|logical|ldivide|lasterr|trimesh|regexpi|polyfit|isindex|isfloat|isfield|isempty|polyint|polyout|polyval|postpad|horzcat|spalloc|setdiff|getppid|ppjumps|getpgrp|geteuid|getegid|genpath|strfind|kendall|frewind|freport|scatter|tempdir|fprintf|formula|fnmatch|filesep|rainbow|saveobj|tsearch|urlread|betainc|reallog|surface|realpow|hamming|gammaln|hanning|hggroup|isalnum|isprime|isalpha|isascii|iscntrl|drawnow|isdigit|subplot|isgraph|rectint|hygecdf|hygeinv|hygepdf|hygernd|idivide|cumprod|cputime|imagesc|imfinfo|strjust|complex|imwrite|strtrim|columns|islower|isprint|ispunct|polygcd|cellstr|isspace|isupper|strread|refresh|residue|toascii|isequal|tolower|addpath|csymamd|invhilb|strtok|imshow|imread|substr|strchr|summer|isprop|hidden|hankel|gunzip|symvar|isunix|ginput|geornd|strcat|geopdf|geoinv|geocdf|gamrnd|krylov|gampdf|gaminv|gamcdf|fsolve|flipud|legend|fliplr|figure|t_test|factor|ezsurf|ezplot|ezmesh|exprnd|exppdf|expinv|expcdf|eomday|loglog|delete|deconv|unique|unmkpp|unpack|unwrap|u_test|copper|vander|compan|clabel|wblcdf|manova|center|wblinv|wblpdf|meansq|median|stairs|wblrnd|spring|blanks|bitset|mexext|bitget|sprand|spones|moment|bitcmp|mpoles|spline|binary|autumn|winter|assert|xlabel|ylabel|zlabel|z_test|ndgrid|bsxfun|usleep|unlink|uminus|colamd|colloc|tmpnam|cummax|sphere|system|cummin|struct|strcmp|stdout|stderr|sscanf|source|orient|sizeof|dbdown|pareto|single|pascal|setenv|dbstop|rmpath|dbtype|pcolor|resize|rename|rehash|dmperm|putenv|filter|printf|pclose|givens|gmtime|rotdim|plotyy|lookup|nargin|mtimes|mpower|mkfifo|setxor|mktime|length|regexp|isreal|isieee|ischar|iscell|isbool|intmin|intmax|inline|ifelse|sparse|getuid|getpid|ppplot|getgid|getenv|prepad|primes|sprank|fwrite|fskipl|probit|fscanf|qqplot|quadcc|quadgk|strrep|symamd|quiver|qzhess|symrcm|fflush|ferror|saveas|fclose|fclear|betaln|erfinv|finite|record|evalin|double|cumsum|bitxor|bitmax|bitand|repmat|atexit|ribbon|rindex|lgamma|roundb|rosser|isnull|untar|ftell|hypot|roots|schur|ranks|input|range|randi|quadv|quadl|kbhit|rcond|prism|print|ppval|ppint|ppder|fseek|randp|polar|shift|randn|randg|rande|fread|lstat|perms|fputs|slice|peaks|merge|pchip|round|patch|sqrtm|minus|mkdir|ocean|speed|fopen|speye|spfun|lower|fgets|mlock|ndims|luinc|fgetl|meshz|meshc|lsode|feval|bitor|numel|fdisp|ifftn|magic|nzmax|logit|fcntl|pause|acosh|popen|power|ismac|isdir|class|isnan|acoth|etree|image|hurst|acsch|housh|isinf|angle|histc|reset|rmdir|scanf|asech|surfc|surfl|gtext|sleep|dassl|stdin|gplot|dasrt|table|daspk|sumsq|asinh|times|convn|umask|uname|uplus|upper|atanh|title|errno|zeros|trace|trapz|fzero|false|close|freqz|acosd|fplot|acotd|acscd|anova|ascii|asecd|asind|atand|white|caxis|erfcx|etime|error|exist|clock|colon|gamma|comet|union|ctime|usage|floor|cross|unzip|index|cotd|fmod|cosd|cscd|cool|unix|conv|vech|exec|cond|view|curl|deal|demo|eval|expm|erfc|type|cast|csch|bone|beep|what|fail|barh|coth|axis|axes|fcdf|fill|xlim|trnd|triu|cosh|area|finv|airy|conj|flag|fpdf|tril|whos|ceil|load|frnd|cbrt|exit|imag|beta|tpdf|chol|tinv|path|gcbf|gcbo|text|test|true|atan|disp|glpk|tcdf|diff|tand|asin|diag|gray|grid|stat|svds|size|gzip|surf|rows|hilb|dbup|hist|asec|rats|quit|hold|isna|eigs|acsc|puts|pack|info|fftn|fftw|prod|find|full|acot|ispc|char|plus|pipe|stft|stem|acos|line|ones|logm|hess|ifft|cell|mean|menu|feof|kron|norm|argv|mesh|time|mget|mkpp|mode|mput|news|null|real|pinv|fork|orth|sech|perl|sign|quad|link|sind|rand|sinc|pink|plot|poly|date|sinh|kill|secd|rank|sqrt|rose|home|sort|tanh|glob|rref|xor|get|all|and|run|tan|svd|rat|syl|min|max|pwd|sin|nnz|not|inv|pie|abs|var|pcr|gcd|fft|sec|eig|dot|arg|det|set|sum|tic|toc|vec|inf|Inf|eye|nan|NaN|who|amd|cos|zip|cot|bar|csc|box|erf|cgs|ols|clf|exp|ver|fix|cor|cov|cut|dir|dos|ftp|gca|any|eps|pcg|gcf|tar|gls|hot|clc|hsv|iqr|isa|jet|std|cat|sqp|lcm|spy|log|now|mod|cla|rem|lu|eq|ge|pi|or|ne|qp|qr|lt|qz|le|gt|e)\b">
|
|
<token type="NameBuiltin"/>
|
|
</rule>
|
|
<rule pattern="(OCTAVE_VERSION|WIFCONTINUED|WEXITSTATUS|WIFSIGNALED|OCTAVE_HOME|PAGER_FLAGS|IMAGE_PATH|WIFSTOPPED|WUNTRACED|WIFEXITED|WCOREDUMP|WCONTINUE|EXEC_PATH|S_ISSOCK|WTERMSIG|SEEK_CUR|SEEK_END|SEEK_SET|WSTOPSIG|S_ISFIFO|S_ISREG|S_ISLNK|S_ISCHR|S_ISBLK|WNOHANG|S_ISDIR|EDITOR|PAGER|SIG|NA|I)\b">
|
|
<token type="NameConstant"/>
|
|
</rule>
|
|
<rule pattern="-=|!=|!|/=|--">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="-|==|~=|<|>|<=|>=|&&|&|~|\|\|?">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="[\[\](){}:@.,]">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern="=|:|;">
|
|
<token type="Punctuation"/>
|
|
</rule>
|
|
<rule pattern=""[^"]*"">
|
|
<token type="LiteralString"/>
|
|
</rule>
|
|
<rule pattern="(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="\d+[eEf][+-]?[0-9]+">
|
|
<token type="LiteralNumberFloat"/>
|
|
</rule>
|
|
<rule pattern="\d+">
|
|
<token type="LiteralNumberInteger"/>
|
|
</rule>
|
|
<rule pattern="(?<=[\w)\].])\'+">
|
|
<token type="Operator"/>
|
|
</rule>
|
|
<rule pattern="(?<![\w)\].])\'">
|
|
<token type="LiteralString"/>
|
|
<push state="string"/>
|
|
</rule>
|
|
<rule pattern="[a-zA-Z_]\w*">
|
|
<token type="Name"/>
|
|
</rule>
|
|
<rule pattern=".">
|
|
<token type="Text"/>
|
|
</rule>
|
|
</state>
|
|
<state name="string">
|
|
<rule pattern="[^']*'">
|
|
<token type="LiteralString"/>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
<state name="deffunc">
|
|
<rule pattern="(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)">
|
|
<bygroups>
|
|
<token type="TextWhitespace"/>
|
|
<token type="Text"/>
|
|
<token type="TextWhitespace"/>
|
|
<token type="Punctuation"/>
|
|
<token type="TextWhitespace"/>
|
|
<token type="NameFunction"/>
|
|
<token type="Punctuation"/>
|
|
<token type="Text"/>
|
|
<token type="Punctuation"/>
|
|
<token type="TextWhitespace"/>
|
|
</bygroups>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
<rule pattern="(\s*)([a-zA-Z_]\w*)">
|
|
<bygroups>
|
|
<token type="Text"/>
|
|
<token type="NameFunction"/>
|
|
</bygroups>
|
|
<pop depth="1"/>
|
|
</rule>
|
|
</state>
|
|
</rules>
|
|
</lexer> |