diff options
| author | orbitalquark <70453897+orbitalquark@users.noreply.github.com> | 2024-09-18 14:30:49 -0400 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-01-04 12:29:07 -0700 |
| commit | c1f4d3f68787fa2ae964c468d28a84df37319b28 (patch) | |
| tree | dcd62bd74f8f9fd786cba6a0c248fb388d5244a8 /lua/lexers/logtalk.lua | |
| parent | cc18cea14d1f836abcebb84a96f5029431474255 (diff) | |
| download | vis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.gz vis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.xz | |
lexers: switch to tabs for indentation
Diffstat (limited to 'lua/lexers/logtalk.lua')
| -rw-r--r-- | lua/lexers/logtalk.lua | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/lua/lexers/logtalk.lua b/lua/lexers/logtalk.lua index ffa7595..a4272f8 100644 --- a/lua/lexers/logtalk.lua +++ b/lua/lexers/logtalk.lua @@ -9,53 +9,53 @@ local lex = lexer.new('logtalk', {inherit = lexer.load('prolog')}) -- add logtalk keywords to prolog ones local directives = { - 'set_logtalk_flag', 'object', 'info', 'built_in', 'threaded', 'uses', 'alias', 'use_module', - 'coinductive', 'export', 'reexport', 'public', 'metapredicate', 'mode', 'meta_non_terminal', - 'protected', 'synchronized', 'private', 'module', 'if', 'elif', 'else', 'endif', 'category', - 'protocol', 'end_object', 'end_category', 'end_protocol', 'meta_predicate' + 'set_logtalk_flag', 'object', 'info', 'built_in', 'threaded', 'uses', 'alias', 'use_module', + 'coinductive', 'export', 'reexport', 'public', 'metapredicate', 'mode', 'meta_non_terminal', + 'protected', 'synchronized', 'private', 'module', 'if', 'elif', 'else', 'endif', 'category', + 'protocol', 'end_object', 'end_category', 'end_protocol', 'meta_predicate' } local indent = token(lexer.WHITESPACE, lexer.starts_line(S(' \t')^1))^-1 lex:modify_rule('directive', - (indent * token(lexer.OPERATOR, ':-') * token(lexer.WHITESPACE, S(' \t')^0) * - token(lexer.PREPROCESSOR, word_match(directives)) + (indent * token(lexer.OPERATOR, ':-') * token(lexer.WHITESPACE, S(' \t')^0) * + token(lexer.PREPROCESSOR, word_match(directives)) ) + lex:get_rule('directive')) -- Whitespace. lex:modify_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1)) local zero_arity_keywords = { - -- extracted from test document in logtalk distribution - 'comment', 'argnames', 'arguments', 'author', 'version', 'date', 'parameters', 'parnames', - 'copyright', 'license', 'remarks', 'see_also', 'as', 'logtalk_make', 'instantiation_error', - 'system_error' + -- extracted from test document in logtalk distribution + 'comment', 'argnames', 'arguments', 'author', 'version', 'date', 'parameters', 'parnames', + 'copyright', 'license', 'remarks', 'see_also', 'as', 'logtalk_make', 'instantiation_error', + 'system_error' } local one_plus_arity_keywords = { - -- extracted from test document in logtalk distribution - 'implements', 'imports', 'extends', 'instantiates', 'specializes', 'number_chars', 'number_code', - 'current_category', 'current_object', 'current_protocol', 'create_category', 'create_object', - 'create_protocol', 'abolish_category', 'abolish_object', 'abolish_protocol', 'category_property', - 'object_property', 'protocol_property', 'extends_category', 'extends_object', 'extends_protocol', - 'implements_protocol', 'imports_category', 'instantiates_class', 'specializes_class', - 'complements_object', 'conforms_to_protocol', 'abolish_events', 'current_event', 'define_events', - 'threaded', 'threaded_call', 'threaded_call', 'threaded_once', 'threaded_ignore', 'threaded_exit', - 'threaded_peek', 'threaded_cancel', 'threaded_wait', 'threaded_notify', 'threaded_engine', - 'threaded_engine_create', 'threaded_engine_destroy', 'threaded_engine_self', - 'threaded_engine_next', 'threaded_engine_next_reified', 'threaded_engine_yield', - 'threaded_engine_post', 'threaded_engine_fetch', 'logtalk_compile', 'logtalk_load', - 'logtalk_library_path', 'logtalk_load_context', 'logtalk_make_target_action', - 'current_logtalk_flag', 'set_logtalk_flag', 'create_logtalk_flag', 'context', 'parameter', 'self', - 'sender', 'this', 'type_error', 'domain_error', 'existence_error', 'permission_error', - 'representation_error', 'evaluation_error', 'resource_error', 'syntax_error', 'bagof', 'findall', - 'forall', 'setof', 'before', 'after', 'forward', 'phrase', 'expand_term', 'expand_goal', - 'term_expansion', 'goal_expansion', 'numbervars', 'put_code', 'put_byte', 'current_op', 'op', - 'ignore', 'repeat', 'number_codes', 'current_prolog_flag', 'set_prolog_flag', 'keysort', 'sort' + -- extracted from test document in logtalk distribution + 'implements', 'imports', 'extends', 'instantiates', 'specializes', 'number_chars', 'number_code', + 'current_category', 'current_object', 'current_protocol', 'create_category', 'create_object', + 'create_protocol', 'abolish_category', 'abolish_object', 'abolish_protocol', 'category_property', + 'object_property', 'protocol_property', 'extends_category', 'extends_object', 'extends_protocol', + 'implements_protocol', 'imports_category', 'instantiates_class', 'specializes_class', + 'complements_object', 'conforms_to_protocol', 'abolish_events', 'current_event', 'define_events', + 'threaded', 'threaded_call', 'threaded_call', 'threaded_once', 'threaded_ignore', 'threaded_exit', + 'threaded_peek', 'threaded_cancel', 'threaded_wait', 'threaded_notify', 'threaded_engine', + 'threaded_engine_create', 'threaded_engine_destroy', 'threaded_engine_self', + 'threaded_engine_next', 'threaded_engine_next_reified', 'threaded_engine_yield', + 'threaded_engine_post', 'threaded_engine_fetch', 'logtalk_compile', 'logtalk_load', + 'logtalk_library_path', 'logtalk_load_context', 'logtalk_make_target_action', + 'current_logtalk_flag', 'set_logtalk_flag', 'create_logtalk_flag', 'context', 'parameter', 'self', + 'sender', 'this', 'type_error', 'domain_error', 'existence_error', 'permission_error', + 'representation_error', 'evaluation_error', 'resource_error', 'syntax_error', 'bagof', 'findall', + 'forall', 'setof', 'before', 'after', 'forward', 'phrase', 'expand_term', 'expand_goal', + 'term_expansion', 'goal_expansion', 'numbervars', 'put_code', 'put_byte', 'current_op', 'op', + 'ignore', 'repeat', 'number_codes', 'current_prolog_flag', 'set_prolog_flag', 'keysort', 'sort' } local keyword = word_match(zero_arity_keywords) + (word_match(one_plus_arity_keywords) * #P('(')) lex:modify_rule('keyword', token(lexer.KEYWORD, keyword) + lex:get_rule('keyword')) local operators = { - -- extracted from test document in logtalk distribution - 'as' + -- extracted from test document in logtalk distribution + 'as' } lex:modify_rule('operator', token(lexer.OPERATOR, word_match(operators)) + lex:get_rule('operator')) |
