main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
3.6 KB
|
Line | |
---|
1 | Prism.languages.inform7 = {
|
---|
2 | 'string': {
|
---|
3 | pattern: /"[^"]*"/,
|
---|
4 | inside: {
|
---|
5 | 'substitution': {
|
---|
6 | pattern: /\[[^\[\]]+\]/,
|
---|
7 | inside: {
|
---|
8 | 'delimiter': {
|
---|
9 | pattern: /\[|\]/,
|
---|
10 | alias: 'punctuation'
|
---|
11 | }
|
---|
12 | // See rest below
|
---|
13 | }
|
---|
14 | }
|
---|
15 | }
|
---|
16 | },
|
---|
17 | 'comment': {
|
---|
18 | pattern: /\[[^\[\]]+\]/,
|
---|
19 | greedy: true
|
---|
20 | },
|
---|
21 | 'title': {
|
---|
22 | pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im,
|
---|
23 | alias: 'important'
|
---|
24 | },
|
---|
25 | 'number': {
|
---|
26 | pattern: /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i,
|
---|
27 | lookbehind: true
|
---|
28 | },
|
---|
29 | 'verb': {
|
---|
30 | pattern: /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i,
|
---|
31 | lookbehind: true,
|
---|
32 | alias: 'operator'
|
---|
33 | },
|
---|
34 | 'keyword': {
|
---|
35 | pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,
|
---|
36 | lookbehind: true
|
---|
37 | },
|
---|
38 | 'property': {
|
---|
39 | pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,
|
---|
40 | lookbehind: true,
|
---|
41 | alias: 'symbol'
|
---|
42 | },
|
---|
43 | 'position': {
|
---|
44 | pattern: /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,
|
---|
45 | lookbehind: true,
|
---|
46 | alias: 'keyword'
|
---|
47 | },
|
---|
48 | 'type': {
|
---|
49 | pattern: /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,
|
---|
50 | lookbehind: true,
|
---|
51 | alias: 'variable'
|
---|
52 | },
|
---|
53 | 'punctuation': /[.,:;(){}]/
|
---|
54 | };
|
---|
55 |
|
---|
56 | Prism.languages.inform7['string'].inside['substitution'].inside.rest = Prism.languages.inform7;
|
---|
57 | // We don't want the remaining text in the substitution to be highlighted as the string.
|
---|
58 | Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = {
|
---|
59 | pattern: /\S(?:\s*\S)*/,
|
---|
60 | alias: 'comment'
|
---|
61 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.