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
| /*
| Language: Inform 7
| Author: Bruno Dias <bruno.r.dias@gmail.com>
| Description: Language definition for Inform 7, a DSL for writing parser interactive fiction.
| Website: http://inform7.com
| */
|
| function inform7(hljs) {
| const START_BRACKET = '\\[';
| const END_BRACKET = '\\]';
| return {
| name: 'Inform 7',
| aliases: ['i7'],
| case_insensitive: true,
| keywords: {
| // Some keywords more or less unique to I7, for relevance.
| keyword:
| // kind:
| 'thing room person man woman animal container ' +
| 'supporter backdrop door ' +
| // characteristic:
| 'scenery open closed locked inside gender ' +
| // verb:
| 'is are say understand ' +
| // misc keyword:
| 'kind of rule'
| },
| contains: [
| {
| className: 'string',
| begin: '"',
| end: '"',
| relevance: 0,
| contains: [
| {
| className: 'subst',
| begin: START_BRACKET,
| end: END_BRACKET
| }
| ]
| },
| {
| className: 'section',
| begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/,
| end: '$'
| },
| {
| // Rule definition
| // This is here for relevance.
| begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,
| end: ':',
| contains: [
| {
| // Rule name
| begin: '\\(This',
| end: '\\)'
| }
| ]
| },
| {
| className: 'comment',
| begin: START_BRACKET,
| end: END_BRACKET,
| contains: ['self']
| }
| ]
| };
| }
|
| module.exports = inform7;
|
|