]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/mercury.js
1 /*! `mercury` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= ( function () {
8 Author: mucaho <mkucko@gmail.com>
9 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.
10 Website: https://www.mercurylang.org
14 function mercury ( hljs
) {
17 'module use_module import_module include_module end_module initialise '
18 + 'mutable initialize finalize finalise interface implementation pred '
19 + 'mode func type inst solver any_pred any_func is semidet det nondet '
20 + 'multi erroneous failure cc_nondet cc_multi typeclass instance where '
21 + 'pragma promise external trace atomic or_else require_complete_switch '
22 + 'require_det require_semidet require_multi require_nondet '
23 + 'require_cc_multi require_cc_nondet require_erroneous require_failure' ,
26 'inline no_inline type_spec source_file fact_table obsolete memo '
27 + 'loop_check minimal_model terminates does_not_terminate '
28 + 'check_termination promise_equivalent_clauses '
30 + 'foreign_proc foreign_decl foreign_code foreign_type '
31 + 'foreign_import_module foreign_export_enum foreign_export '
32 + 'foreign_enum may_call_mercury will_not_call_mercury thread_safe '
33 + 'not_thread_safe maybe_thread_safe promise_pure promise_semipure '
34 + 'tabled_for_io local untrailed trailed attach_to_io_state '
35 + 'can_pass_as_mercury_type stable will_not_throw_exception '
36 + 'may_modify_trail will_not_modify_trail may_duplicate '
37 + 'may_not_duplicate affects_liveness does_not_affect_liveness '
38 + 'doesnt_affect_liveness no_sharing unknown_sharing sharing' ,
40 'some all not if then else true fail false try catch catch_any '
41 + 'semidet_true semidet_false semidet_fail impure_true impure semipure'
44 const COMMENT
= hljs
. COMMENT ( '%' , '$' );
48 begin : "0'. \\ |0[box][0-9a-fA-F]*"
51 const ATOM
= hljs
. inherit ( hljs
. APOS_STRING_MODE
, { relevance : 0 });
52 const STRING
= hljs
. inherit ( hljs
. QUOTE_STRING_MODE
, { relevance : 0 });
55 begin : ' \\\\ [abfnrtv] \\ | \\\\ x[0-9a-fA-F]* \\\\\\ |%[-+# *.0-9]*[dioxXucsfeEgGp]' ,
58 STRING
. contains
= STRING
. contains
. slice (); // we need our own copy of contains
59 STRING
. contains
. push ( STRING_FMT
);
62 className : 'built_in' ,
78 const HEAD_BODY_CONJUNCTION
= {
79 className : 'built_in' ,
81 { begin : ':- \\ |-->' },
98 HEAD_BODY_CONJUNCTION
,
100 hljs
. C_BLOCK_COMMENT_MODE
,
105 { // relevance booster
107 { // relevance booster
117 hljs
. registerLanguage ( 'mercury' , hljsGrammar
);