]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/mercury.js
1 /*! `mercury` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= ( function () {
7 Author: mucaho <mkucko@gmail.com>
8 Description: Mercury is a logic/functional programming language which combines the clarity and expressiveness of declarative programming with advanced static analysis and error detection features.
9 Website: https://www.mercurylang.org
13 function mercury ( hljs
) {
16 'module use_module import_module include_module end_module initialise '
17 + 'mutable initialize finalize finalise interface implementation pred '
18 + 'mode func type inst solver any_pred any_func is semidet det nondet '
19 + 'multi erroneous failure cc_nondet cc_multi typeclass instance where '
20 + 'pragma promise external trace atomic or_else require_complete_switch '
21 + 'require_det require_semidet require_multi require_nondet '
22 + 'require_cc_multi require_cc_nondet require_erroneous require_failure' ,
25 'inline no_inline type_spec source_file fact_table obsolete memo '
26 + 'loop_check minimal_model terminates does_not_terminate '
27 + 'check_termination promise_equivalent_clauses '
29 + 'foreign_proc foreign_decl foreign_code foreign_type '
30 + 'foreign_import_module foreign_export_enum foreign_export '
31 + 'foreign_enum may_call_mercury will_not_call_mercury thread_safe '
32 + 'not_thread_safe maybe_thread_safe promise_pure promise_semipure '
33 + 'tabled_for_io local untrailed trailed attach_to_io_state '
34 + 'can_pass_as_mercury_type stable will_not_throw_exception '
35 + 'may_modify_trail will_not_modify_trail may_duplicate '
36 + 'may_not_duplicate affects_liveness does_not_affect_liveness '
37 + 'doesnt_affect_liveness no_sharing unknown_sharing sharing' ,
39 'some all not if then else true fail false try catch catch_any '
40 + 'semidet_true semidet_false semidet_fail impure_true impure semipure'
43 const COMMENT
= hljs
. COMMENT ( '%' , '$' );
47 begin : "0'. \\ |0[box][0-9a-fA-F]*"
50 const ATOM
= hljs
. inherit ( hljs
. APOS_STRING_MODE
, { relevance : 0 });
51 const STRING
= hljs
. inherit ( hljs
. QUOTE_STRING_MODE
, { relevance : 0 });
54 begin : ' \\\\ [abfnrtv] \\ | \\\\ x[0-9a-fA-F]* \\\\\\ |%[-+# *.0-9]*[dioxXucsfeEgGp]' ,
57 STRING
. contains
= STRING
. contains
. slice (); // we need our own copy of contains
58 STRING
. contains
. push ( STRING_FMT
);
61 className : 'built_in' ,
77 const HEAD_BODY_CONJUNCTION
= {
78 className : 'built_in' ,
80 { begin : ':- \\ |-->' },
97 HEAD_BODY_CONJUNCTION
,
99 hljs
. C_BLOCK_COMMENT_MODE
,
104 { // relevance booster
106 { // relevance booster
116 export default hljsGrammar
;