-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpie.js
More file actions
74 lines (65 loc) · 1.49 KB
/
Copy pathpie.js
File metadata and controls
74 lines (65 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Language: PIE
Author: Vladimir Alexiev <vladimir.alexiev@ontotext.com>
Category: common
Description: GraphDB Rules language for semantic reasoning
Website: http://graphdb.ontotext.com/documentation/standard/reasoning.html
*/
const pie_highlight = function (hljs) {
var KEYWORDS = {
begin: /^(Prefices|Axioms|Rules)/, end: /\s*\{/,
keywords: 'Prefices|20 Axioms|10 Rules|10'
};
var PREFIX = {
begin: /^\s*\w+\s*:\s*\w+:\/\/\S+\s*$/,
className: 'symbol',
};
var INFER_LINE = {
begin: /---+/,
className: 'keyword',
relevance: 0
};
var RULE = {
begin: /\b(Id|Consistency)\s*:/, end: '\n',
keywords: 'Id|1 Consistency|10',
contains: [{ begin: hljs.IDENT_RE, className: 'title' }]
};
var ANNOTATION = {
begin: /\[(Constraint|Context|Cut)/,
keywords: { function: 'Constraint|10 Context|0 Cut|10' },
};
var SYMBOL = {
begin: /</, end: />/,
contains: [{ begin: /[\w:]+/ }],
className: 'symbol',
relevance: 1
};
var VAR = {
begin: hljs.IDENT_RE,
className: 'variable',
relevance: 0,
};
var DATATYPE = {
begin: /\^\^[\w:]+/,
className: 'type',
relevance: 1
};
return {
// case_insensitive: true,
aliases: ['pie', 'rules'],
contains: [
KEYWORDS,
PREFIX,
hljs.QUOTE_STRING_MODE,
hljs.APOS_STRING_MODE,
DATATYPE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
RULE,
ANNOTATION,
SYMBOL,
VAR,
INFER_LINE,
]
};
}