297 lines
14 KiB
JSON
297 lines
14 KiB
JSON
![]() |
{
|
||
|
"comment": "This Source Code Form is subject to the terms of the Mozilla Public License,\nv. 2.0. If a copy of the MPL was not distributed with this file, You can obtain\none at http://mozilla.org/MPL/2.0/.",
|
||
|
"name": "prolog",
|
||
|
"scopeName": "source.prolog",
|
||
|
"fileTypes": ["pl", "pro"],
|
||
|
"uuid": "df89928b-6612-475a-b414-f319d9b98664",
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#comments"
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.clause.body.prolog",
|
||
|
"begin": "(?<=:-)\\s*",
|
||
|
"end": "(\\.)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.control.clause.bodyend.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#comments"
|
||
|
},
|
||
|
{
|
||
|
"include": "#builtin"
|
||
|
},
|
||
|
{
|
||
|
"include": "#controlandkeywords"
|
||
|
},
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"include": "#constants"
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.clause.body.prolog",
|
||
|
"match": "."
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.clause.head.prolog",
|
||
|
"begin": "^\\s*([a-z][a-zA-Z0-9_]*)(\\(?)(?=.*:-.*)",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.function.clause.prolog"
|
||
|
},
|
||
|
"2": {
|
||
|
"name": "punctuation.definition.parameters.begin"
|
||
|
}
|
||
|
},
|
||
|
"end": "((\\)?))\\s*(:-)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "punctuation.definition.parameters.end"
|
||
|
},
|
||
|
"3": {
|
||
|
"name": "keyword.control.clause.bodybegin.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"include": "#constants"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.dcg.head.prolog",
|
||
|
"begin": "^\\s*([a-z][a-zA-Z0-9_]*)(\\(?)(?=.*-->.*)",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.function.dcg.prolog"
|
||
|
},
|
||
|
"2": {
|
||
|
"name": "punctuation.definition.parameters.begin"
|
||
|
}
|
||
|
},
|
||
|
"end": "((\\)?))\\s*(-->)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "punctuation.definition.parameters.end"
|
||
|
},
|
||
|
"3": {
|
||
|
"name": "keyword.control.dcg.bodybegin.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"include": "#constants"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.dcg.body.prolog",
|
||
|
"begin": "(?<=-->)\\s*",
|
||
|
"end": "(\\.)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.control.dcg.bodyend.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#comments"
|
||
|
},
|
||
|
{
|
||
|
"include": "#controlandkeywords"
|
||
|
},
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"include": "#constants"
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.dcg.body.prolog",
|
||
|
"match": "."
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.fact.prolog",
|
||
|
"begin": "^\\s*([a-zA-Z][a-zA-Z0-9_]*)(\\(?)(?!.*(:-|-->).*)",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "entity.name.function.fact.prolog"
|
||
|
},
|
||
|
"2": {
|
||
|
"name": "punctuation.definition.parameters.begin"
|
||
|
}
|
||
|
},
|
||
|
"end": "((\\)?))\\s*(\\.)(?!\\d+)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "punctuation.definition.parameters.end"
|
||
|
},
|
||
|
"3": {
|
||
|
"name": "keyword.control.fact.end.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "#comments"
|
||
|
},
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"include": "#constants"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"repository": {
|
||
|
"atom": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "constant.other.atom.simple.prolog",
|
||
|
"match": "(?<![a-zA-Z0-9_])[a-z][a-zA-Z0-9_]*(?!\\s*\\(|[a-zA-Z0-9_])"
|
||
|
},
|
||
|
{
|
||
|
"name": "constant.other.atom.quoted.prolog",
|
||
|
"match": "'.*?'"
|
||
|
},
|
||
|
{
|
||
|
"name": "constant.other.atom.emptylist.prolog",
|
||
|
"match": "\\[\\]"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"builtin": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "keyword.other",
|
||
|
"match": "\\b(op|nl|fail|dynamic|discontiguous|initialization|meta_predicate|module_transparent|multifile|public|thread_local|thread_initialization|volatile)\\b"
|
||
|
},
|
||
|
{
|
||
|
"name": "support.function.builtin.prolog",
|
||
|
"match": "\\b(abolish|abort|abs|absolute_file_name|access_file|acos|acosh|acyclic_term|add_import_module|append|apropos|arg|asin|asinh|assert|asserta|assertz|at_end_of_stream|at_halt|atan|atanh|atom|atom_chars|atom_codes|atom_concat|atom_length|atom_number|atom_prefix|atom_string|atom_to_stem_list|atom_to_term|atomic|atomic_concat|atomic_list_concat|atomics_to_string|attach_packs|attr_portray_hook|attr_unify_hook|attribute_goals|attvar|autoload|autoload_path|b_getval|b_set_dict|b_setval|bagof|begin_tests|between|blob|break|byte_count|call_dcg|call_residue_vars|callable|cancel_halt|catch|ceil|ceiling|char_code|char_conversion|char_type|character_count|chdir|chr_leash|chr_notrace|chr_show_store|chr_trace|clause|clause_property|close|close_dde_conversation|close_table|code_type|collation_key|compare|compare_strings|compile_aux_clauses|compile_predicates|compiling|compound|compound_name_arguments|compound_name_arity|consult|context_module|copy_predicate_clauses|copy_stream_data|copy_term|copy_term_nat|copysign|cos|cosh|cputime|create_prolog_flag|current_arithmetic_function|current_atom|current_blob|current_char_conversion|current_engine|current_flag|current_format_predicate|current_functor|current_input|current_key|current_locale|current_module|current_op|current_output|current_predicate|current_prolog_flag|current_signal|current_stream|current_trie|cyclic_term|date_time_stamp|date_time_value|day_of_the_week|dcg_translate_rule|dde_current_connection|dde_current_service|dde_execute|dde_poke|dde_register_service|dde_request|dde_unregister_service|debug|debugging|default_module|del_attr|del_attrs|del_dict|delete_directory|delete_file|delete_import_module|deterministic|dict_create|dict_pairs|dif|directory_files|divmod|doc_browser|doc_collect|doc_load_library|doc_server|double_metaphone|downcase_atom|dtd|dtd_property|duplicate_term|dwim_match|dwim_predicate|e|edit|encoding|engine_create|engine_fetch|engine_next|engine_next_reified|engine_post|engine_self|engine_yield|ensure_loaded|epsilon|erase|erf|erfc|eval|exception|exists_directory|exists_file|exists_source|exp|expand_answer|expand_file_name|expand_file_search_path|expand_goal|expand_query|expand_term|explain|fast_read|fast_term_serialized|fast_write|file_base_name|file_directory_name|file_name_extension|file_search_path|fill_buffer|find_chr_constraint|findall|findnsols|flag|float|float_fractional_part|float_integer_part|floor|flush_output|forall|format|format_predicate|format_time|free_dtd|free_sgml_parser|free_table|freeze|frozen|functor|garbage_collect|garbage_collect_atoms|garbage_collect_clauses|gdebug|get|get_attr|get_attrs|get_byte|get_char|get_code|get_dict|get_flag|get_sgml_parser|get_single_char|get_string_code|get_table_attribute|get_time|getbit|getenv|goal_expansion|ground|gspy|gtrace|guitracer|gxref|gzopen|halt|help|import_module|in_pce_thread|in_pce_thread_sync|in_table|include|inf|instance|integer|iri_xml_namespace|is_absolute_file_name|is_dict|is_engine|is_list|is_stream|is_thread|keysort|known_licenses|leash|length|lgamma|library_directory|license|line_count|line_position|list_strings|listing|load_dtd|load_files|load_html|load_rdf|load_sgml|load_structure|load_test_files|load_xml|locale_create|locale_destroy|locale_property|locale_sort|log|lsb|make|make_directory|make_library_index|max|memberchk|message_hook|message_property|message_queue_create|message_queue_destroy|message_queue_property|message_to_string|min|module|module_property|msb|msort|mutex_create|mutex_destroy|mutex_lock|mutex_property|mutex_statistics|mutex_trylock|mutex_unlock|name|nan|nb_current|nb_delete|nb_getval|nb_link_dict|nb_linkarg|nb_linkval|nb_set_dict|nb_setarg|nb_setval|new_dtd|new_order_table|new_sgml_parser|new_table|nl|nodebug|noguitracer|nonvar|noprotocol|normalize_space|nospy|nospyall|notrace|nth_clause|nth_integer_root_and_remainder|number|number_chars|number_codes|number_string|numbervars|odbc_close_statement|odbc_connect|odbc_current_connection|odbc_current_table|odbc_data_source|odbc_debug|odbc_disconnect|odbc_driver_connect|odbc_end_transaction|odbc_execute|odbc_fet
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"comments": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "comment.line.percent-sign.prolog",
|
||
|
"match": "%.*"
|
||
|
},
|
||
|
{
|
||
|
"name": "comment.block.prolog",
|
||
|
"begin": "/\\*",
|
||
|
"end": "\\*/",
|
||
|
"captures": {
|
||
|
"0": {
|
||
|
"name": "punctuation.definition.comment.prolog"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"constants": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "constant.numeric.integer.prolog",
|
||
|
"match": "(?<![a-zA-Z]|/)(\\d+|(\\d+\\.\\d+))"
|
||
|
},
|
||
|
{
|
||
|
"name": "string.quoted.double.prolog",
|
||
|
"match": "\".*?\""
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"controlandkeywords": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "meta.if.prolog",
|
||
|
"begin": "(->)",
|
||
|
"beginCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.control.if.prolog"
|
||
|
}
|
||
|
},
|
||
|
"end": "(;)",
|
||
|
"endCaptures": {
|
||
|
"1": {
|
||
|
"name": "keyword.control.else.prolog"
|
||
|
}
|
||
|
},
|
||
|
"patterns": [
|
||
|
{
|
||
|
"include": "$self"
|
||
|
},
|
||
|
{
|
||
|
"include": "#builtin"
|
||
|
},
|
||
|
{
|
||
|
"include": "#comments"
|
||
|
},
|
||
|
{
|
||
|
"include": "#atom"
|
||
|
},
|
||
|
{
|
||
|
"include": "#variable"
|
||
|
},
|
||
|
{
|
||
|
"name": "meta.if.body.prolog",
|
||
|
"match": "."
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "keyword.control.cut.prolog",
|
||
|
"match": "!"
|
||
|
},
|
||
|
{
|
||
|
"name": "keyword.operator.prolog",
|
||
|
"match": "(\\s(is)\\s)|=:=|=\\.\\.|=?\\\\?=|\\\\\\+|@?>|@?=?<|\\+|\\*|\\-"
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"variable": {
|
||
|
"patterns": [
|
||
|
{
|
||
|
"name": "variable.parameter.uppercase.prolog",
|
||
|
"match": "(?<![a-zA-Z0-9_])[A-Z][a-zA-Z0-9_]*"
|
||
|
},
|
||
|
{
|
||
|
"name": "variable.language.anonymous.prolog",
|
||
|
"match": "(?<!\\w)_"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|