tartrazine/lexers/octave.xml

102 lines
13 KiB
XML
Raw Normal View History

2024-08-02 20:03:49 +00:00
<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|issquar
<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="-|==|~=|&lt;|&gt;|&lt;=|&gt;=|&amp;&amp;|&amp;|~|\|\|?">
<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="&#34;[^&#34;]*&#34;">
<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="(?&lt;=[\w)\].])\&#39;+">
<token type="Operator"/>
</rule>
<rule pattern="(?&lt;![\w)\].])\&#39;">
<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="[^&#39;]*&#39;">
<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>
2024-08-26 23:18:28 +00:00
</lexer>