main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
4.0 KB
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | module.exports = inform7
|
---|
4 | inform7.displayName = 'inform7'
|
---|
5 | inform7.aliases = []
|
---|
6 | function inform7(Prism) {
|
---|
7 | Prism.languages.inform7 = {
|
---|
8 | string: {
|
---|
9 | pattern: /"[^"]*"/,
|
---|
10 | inside: {
|
---|
11 | substitution: {
|
---|
12 | pattern: /\[[^\[\]]+\]/,
|
---|
13 | inside: {
|
---|
14 | delimiter: {
|
---|
15 | pattern: /\[|\]/,
|
---|
16 | alias: 'punctuation'
|
---|
17 | } // See rest below
|
---|
18 | }
|
---|
19 | }
|
---|
20 | }
|
---|
21 | },
|
---|
22 | comment: {
|
---|
23 | pattern: /\[[^\[\]]+\]/,
|
---|
24 | greedy: true
|
---|
25 | },
|
---|
26 | title: {
|
---|
27 | pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im,
|
---|
28 | alias: 'important'
|
---|
29 | },
|
---|
30 | number: {
|
---|
31 | pattern:
|
---|
32 | /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i,
|
---|
33 | lookbehind: true
|
---|
34 | },
|
---|
35 | verb: {
|
---|
36 | pattern:
|
---|
37 | /(^|[^-])\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,
|
---|
38 | lookbehind: true,
|
---|
39 | alias: 'operator'
|
---|
40 | },
|
---|
41 | keyword: {
|
---|
42 | pattern:
|
---|
43 | /(^|[^-])\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,
|
---|
44 | lookbehind: true
|
---|
45 | },
|
---|
46 | property: {
|
---|
47 | pattern:
|
---|
48 | /(^|[^-])\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,
|
---|
49 | lookbehind: true,
|
---|
50 | alias: 'symbol'
|
---|
51 | },
|
---|
52 | position: {
|
---|
53 | pattern:
|
---|
54 | /(^|[^-])\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,
|
---|
55 | lookbehind: true,
|
---|
56 | alias: 'keyword'
|
---|
57 | },
|
---|
58 | type: {
|
---|
59 | pattern:
|
---|
60 | /(^|[^-])\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,
|
---|
61 | lookbehind: true,
|
---|
62 | alias: 'variable'
|
---|
63 | },
|
---|
64 | punctuation: /[.,:;(){}]/
|
---|
65 | }
|
---|
66 | Prism.languages.inform7['string'].inside['substitution'].inside.rest =
|
---|
67 | Prism.languages.inform7 // We don't want the remaining text in the substitution to be highlighted as the string.
|
---|
68 | Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = {
|
---|
69 | pattern: /\S(?:\s*\S)*/,
|
---|
70 | alias: 'comment'
|
---|
71 | }
|
---|
72 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.