Commit d2595b4580edd7b21a25035bbaad194a798a2545

Golmote 2015-09-06T19:48:49

Merge pull request #616 from Golmote/prism-inform7 Add support for Inform 7

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
diff --git a/components.js b/components.js
index c0edbde..84bb3a4 100644
--- a/components.js
+++ b/components.js
@@ -194,6 +194,10 @@ var components = {
 			"title": "HTTP",
 			"owner": "danielgtaylor"
 		},
+		"inform7": {
+			"title": "Inform 7",
+			"owner": "Golmote"
+		},
 		"ini": {
 			"title": "Ini",
 			"owner": "aviaryan"
diff --git a/components/prism-inform7.js b/components/prism-inform7.js
new file mode 100644
index 0000000..91aca0e
--- /dev/null
+++ b/components/prism-inform7.js
@@ -0,0 +1,58 @@
+Prism.languages.inform7 = {
+	'string': {
+		pattern: /"[^"]*"/,
+		inside: {
+			'substitution': {
+				pattern: /\[[^\]]+\]/,
+				inside: {
+					'delimiter': {
+						pattern:/\[|\]/,
+						alias: 'punctuation'
+					}
+					// See rest below
+				}
+			}
+		}
+	},
+	'comment': /\[[^\]]+\]/,
+	'title': {
+		pattern: /^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,
+		alias: 'important'
+	},
+	'number': {
+		pattern: /(^|[^-])(?:(?:\b|-)\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,
+		lookbehind: true
+	},
+	'verb': {
+		pattern: /(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,
+		lookbehind: true,
+		alias: 'operator'
+	},
+	'keyword': {
+		pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|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,
+		lookbehind: true
+	},
+	'property': {
+		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(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,
+		lookbehind: true,
+		alias: 'symbol'
+	},
+	'position': {
+		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,
+		lookbehind: true,
+		alias: 'keyword'
+	},
+	'type': {
+		pattern: /(^|[^-])\b(?:actions?|activit(?:y|ies)|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,
+		lookbehind: true,
+		alias: 'variable'
+	},
+	'punctuation': /[.,:;(){}]/
+};
+
+Prism.languages.inform7['string'].inside['substitution'].inside.rest = Prism.util.clone(Prism.languages.inform7);
+// We don't want the remaining text in the substitution to be highlighted as the string.
+Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = {
+	pattern: /\S(?:\s*\S)*/,
+	alias: 'comment'
+};
\ No newline at end of file
diff --git a/components/prism-inform7.min.js b/components/prism-inform7.min.js
new file mode 100644
index 0000000..aa3df9b
--- /dev/null
+++ b/components/prism-inform7.min.js
@@ -0,0 +1 @@
+Prism.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:/\[[^\]]+\]/,title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:(?:\b|-)\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|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,lookbehind:!0},property:{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(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{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,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|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,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},Prism.languages.inform7.string.inside.substitution.inside.rest=Prism.util.clone(Prism.languages.inform7),Prism.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"};
\ No newline at end of file
diff --git a/examples/prism-inform7.html b/examples/prism-inform7.html
new file mode 100644
index 0000000..ee56883
--- /dev/null
+++ b/examples/prism-inform7.html
@@ -0,0 +1,177 @@
+<h1>Inform 7</h1>
+<p>To use this language, use the class "language-inform7".</p>
+
+<h2>Comments</h2>
+<pre><code>[This is a comment]
+[This is a
+multi-line comment]</code></pre>
+
+<h2>Texts</h2>
+<pre><code>"This is a string"
+"This is a
+multi-line string"</code></pre>
+
+<h2>Numbers</h2>
+<pre><code>42
+3.14159
+50kg
+100m
+one
+three
+twelve</code></pre>
+
+<h2>Titles</h2>
+<pre><code>Section 2 - Flamsteed's Balloon
+
+Part SR1 - The Physical World Model
+
+Table of Floors</code></pre>
+
+<h2>Standard kinds, verbs and keywords</h2>
+<pre><code>In the Treehouse is a container called the cardboard box.
+The cardboard box is a closed container. The glass bottle is a transparent open container. The box is fixed in place and openable.
+
+Check photographing:
+    if the noun is the camera, say "Sadly impossible." instead.</code></pre>
+
+<h2>Text substitution</h2>
+<pre><code>"[if the player is in Center Ring]A magician's booth stands in the corner, painted dark blue with glittering gold stars.[otherwise if the magician's booth is closed]A crack of light indicates the way back out to the center ring.[otherwise]The door stands open to the outside.[end if]".</code></pre>
+
+<h2>Full example</h2>
+<pre><code>"Lakeside Living"
+
+A volume is a kind of value. 15.9 fl oz specifies a volume with parts ounces and tenths (optional, preamble optional).
+
+A fluid container is a kind of container. A fluid container has a volume called a fluid capacity. A fluid container has a volume called current volume.
+
+The fluid capacity of a fluid container is usually 12.0 fl oz. The current volume of a fluid container is usually 0.0 fl oz.
+
+Liquid is a kind of value. The liquids are water, absinthe, and iced tea. A fluid container has a liquid.
+
+Instead of examining a fluid container:
+    if the noun is empty,
+        say "You catch just a hint of [the liquid of the noun] at the bottom.";
+    otherwise
+        say "[The noun] contains [current volume of the noun in rough terms] of [liquid of the noun]."
+
+To say (amount - a volume) in rough terms:
+    if the amount is less than 0.5 fl oz:
+        say "a swallow or two";
+    otherwise if tenths part of amount is greater than 3 and tenths part of amount is less than 7:
+        let estimate be ounces part of amount;
+        say "[estimate in words] or [estimate plus 1 in words] fluid ounces";
+    otherwise:
+        if tenths part of amount is greater than 6, increase amount by 1.0 fl oz;
+        say "about [ounces part of amount in words] fluid ounce[s]".
+
+Before printing the name of a fluid container (called the target) while not drinking or pouring:
+    if the target is empty:
+        say "empty ";
+    otherwise:
+        do nothing.
+
+After printing the name of a fluid container (called the target) while not examining or pouring:
+    unless the target is empty:
+        say " of [liquid of the target]";
+        omit contents in listing.
+
+Instead of inserting something into a fluid container:
+    say "[The second noun] has too narrow a mouth to accept anything but liquids."
+
+Definition: a fluid container is empty if the current volume of it is 0.0 fl oz. Definition: a fluid container is full if the current volume of it is the fluid capacity of it.
+
+Understand "drink from [fluid container]" as drinking.
+
+Instead of drinking a fluid container:
+    if the noun is empty:
+        say "There is no more [liquid of the noun] within." instead;
+    otherwise:
+        decrease the current volume of the noun by 0.2 fl oz;
+        if the current volume of the noun is less than 0.0 fl oz, now the current volume of the noun is 0.0 fl oz;
+        say "You take a sip of [the liquid of the noun][if the noun is empty], leaving [the noun] empty[end if]."
+
+Part 2 - Filling
+
+Understand the command "fill" as something new.
+
+Understand "fill [fluid container] with/from [full liquid source]" as filling it with. Understand "fill [fluid container] with/from [fluid container]" as filling it with.
+
+Understand "fill [something] with/from [something]" as filling it with.
+
+Filling it with is an action applying to two things. Carry out filling it with: try pouring the second noun into the noun instead.
+
+Understand "pour [fluid container] in/into/on/onto [fluid container]" as pouring it into. Understand "empty [fluid container] into [fluid container]" as pouring it into.
+
+Understand "pour [something] in/into/on/onto [something]" as pouring it into. Understand "empty [something] into [something]" as pouring it into.
+
+Pouring it into is an action applying to two things.
+
+Check pouring it into:
+    if the noun is not a fluid container, say "You can't pour [the noun]." instead;
+    if the second noun is not a fluid container, say "You can't pour liquids into [the second noun]." instead;
+    if the noun is the second noun, say "You can hardly pour [the noun] into itself." instead;
+    if the liquid of the noun is not the liquid of the second noun:
+        if the second noun is empty, now the liquid of the second noun is the liquid of the noun;
+        otherwise say "Mixing [the liquid of the noun] with [the liquid of the second noun] would give unsavory results." instead;
+    if the noun is empty, say "No more [liquid of the noun] remains in [the noun]." instead;
+    if the second noun is full, say "[The second noun] cannot contain any more than it already holds." instead.
+
+Carry out pouring it into:
+    let available capacity be the fluid capacity of the second noun minus the current volume of the second noun;
+    if the available capacity is greater than the current volume of the noun, now the available capacity is the current volume of the noun;
+    increase the current volume of the second noun by available capacity;
+    decrease the current volume of the noun by available capacity.
+
+Report pouring it into:
+    say "[if the noun is empty][The noun] is now empty;[otherwise][The noun] now contains [current volume of the noun in rough terms] of [liquid of the noun]; [end if]";
+    say "[the second noun] contains [current volume of the second noun in rough terms] of [liquid of the second noun][if the second noun is full], and is now full[end if]."
+
+Understand the liquid property as describing a fluid container. Understand "of" as a fluid container.
+
+A liquid source is a kind of fluid container. A liquid source has a liquid. A liquid source is usually scenery. The fluid capacity of a liquid source is usually 3276.7 fl oz. The current volume of a liquid source is usually 3276.7 fl oz. Instead of examining a liquid source: say "[The noun] is full of [liquid of the noun]."
+
+Carry out pouring a liquid source into something: now the current volume of the noun is 3276.7 fl oz.
+
+After pouring a liquid source into a fluid container:
+    say "You fill [the second noun] up with [liquid of the noun] from [the noun]."
+
+Instead of pouring a fluid container into a liquid source:
+    if the noun is empty, say "[The noun] is already empty." instead;
+    now the current volume of the noun is 0.0 fl oz;
+    say "You dump out [the noun] into [the second noun]."
+
+Swimming is an action applying to nothing. Understand "swim" or "dive" as swimming.
+
+Instead of swimming in the presence of a liquid source:
+    say "You don't feel like a dip just now."
+
+Before inserting something into a liquid source: say "[The noun] would get lost and never be seen again." instead.
+
+Part 3 - Scenario
+
+The Lakeside is a room. The Lakeside swing is an enterable supporter in the Lakeside. "Here you are by the lake, enjoying a summery view."
+
+The glass is a fluid container carried by the player. The liquid of the glass is absinthe. The current volume of the glass is 0.8 fl oz.
+
+The pitcher is a fluid container in the Lakeside. The fluid capacity of the pitcher is 32.0 fl oz. The current volume of the pitcher is 20.0 fl oz. The liquid of the pitcher is absinthe.
+
+The lake is a liquid source. It is in the Lakeside.
+
+The player wears a bathing outfit. The description of the bathing outfit is "Stylishly striped in blue and white, and daringly cut to reveal almost all of your calves, and quite a bit of upper arm, as well. You had a moral struggle, purchasing it; but mercifully the lakeshore is sufficiently secluded that no one can see you in this immodest apparel."
+
+Instead of taking off the outfit: say "What odd ideas come into your head sometimes!"
+
+Test me with "fill glass / empty absinthe into lake / fill glass / swim / drink lake / drink / x water / x lake". </code></pre>
+
+<h2>Known failures</h2>
+<p>There are certain edge cases where Prism will fail.
+	There are always such cases in every regex-based syntax highlighter.
+	However, Prism dares to be open and honest about them.
+	If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
+</p>
+
+<h3>String inside a comment</h3>
+<pre><code>[This "comment" is broken]</code></pre>
+
+<h3>Names starting with a number</h3>
+<pre><code>The box 1A is a container</code></pre>
\ No newline at end of file
diff --git a/plugins/show-language/prism-show-language.js b/plugins/show-language/prism-show-language.js
index b5e37f4..242d0ec 100644
--- a/plugins/show-language/prism-show-language.js
+++ b/plugins/show-language/prism-show-language.js
@@ -5,7 +5,7 @@ if (typeof self === 'undefined' || !self.Prism || !self.document) {
 }
 
 // The languages map is built automatically with gulp
-var Languages = /*languages_placeholder[*/{"css":"CSS","clike":"C-like","javascript":"JavaScript","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","nasm":"NASM","nsis":"NSIS","objectivec":"Objective-C","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
+var Languages = /*languages_placeholder[*/{"css":"CSS","clike":"C-like","javascript":"JavaScript","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","nasm":"NASM","nsis":"NSIS","objectivec":"Objective-C","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
 Prism.hooks.add('before-highlight', function(env) {
 	var pre = env.element.parentNode;
 	if (!pre || !/pre/i.test(pre.nodeName)) {
diff --git a/plugins/show-language/prism-show-language.min.js b/plugins/show-language/prism-show-language.min.js
index 9e63d33..40222b3 100644
--- a/plugins/show-language/prism-show-language.min.js
+++ b/plugins/show-language/prism-show-language.min.js
@@ -1 +1 @@
-!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e={css:"CSS",clike:"C-like",javascript:"JavaScript",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",nasm:"NASM",nsis:"NSIS",objectivec:"Objective-C",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(s){var t=s.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var a=e[s.language]||s.language.substring(0,1).toUpperCase()+s.language.substring(1);t.setAttribute("data-language",a)}})}}();
\ No newline at end of file
+!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e={css:"CSS",clike:"C-like",javascript:"JavaScript",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",nasm:"NASM",nsis:"NSIS",objectivec:"Objective-C",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(s){var t=s.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var a=e[s.language]||s.language.substring(0,1).toUpperCase()+s.language.substring(1);t.setAttribute("data-language",a)}})}}();
\ No newline at end of file
diff --git a/tests/languages/inform7/comment_feature.test b/tests/languages/inform7/comment_feature.test
new file mode 100644
index 0000000..f0aedfe
--- /dev/null
+++ b/tests/languages/inform7/comment_feature.test
@@ -0,0 +1,15 @@
+[Foobar]
+[Foo
+bar
+baz]
+
+----------------------------------------------------
+
+[
+	["comment", "[Foobar]"],
+	["comment", "[Foo\r\nbar\r\nbaz]"]
+]
+
+----------------------------------------------------
+
+Checks for comments.
\ No newline at end of file
diff --git a/tests/languages/inform7/keyword_feature.test b/tests/languages/inform7/keyword_feature.test
new file mode 100644
index 0000000..b2497b4
--- /dev/null
+++ b/tests/languages/inform7/keyword_feature.test
@@ -0,0 +1,85 @@
+after
+before
+carry out
+check
+continue the action
+definition :
+do nothing
+else
+end if
+end unless
+end the story
+every turn
+if
+include
+instead
+instead of
+let
+move
+no
+now
+otherwise
+repeat
+report
+resume the story
+rule for
+running through
+say
+saying
+stop the action
+test
+try
+trying
+understand
+unless
+use
+when
+while
+yes
+
+----------------------------------------------------
+
+[
+	["keyword", "after"],
+	["keyword", "before"],
+	["keyword", "carry out"],
+	["keyword", "check"],
+	["keyword", "continue the action"],
+	["keyword", "definition"], ["punctuation", ":"],
+	["keyword", "do nothing"],
+	["keyword", "else"],
+	["keyword", "end if"],
+	["keyword", "end unless"],
+	["keyword", "end the story"],
+	["keyword", "every turn"],
+	["keyword", "if"],
+	["keyword", "include"],
+	["keyword", "instead"],
+	["keyword", "instead of"],
+	["keyword", "let"],
+	["keyword", "move"],
+	["keyword", "no"],
+	["keyword", "now"],
+	["keyword", "otherwise"],
+	["keyword", "repeat"],
+	["keyword", "report"],
+	["keyword", "resume the story"],
+	["keyword", "rule for"],
+	["keyword", "running through"],
+	["keyword", "say"],
+	["keyword", "saying"],
+	["keyword", "stop the action"],
+	["keyword", "test"],
+	["keyword", "try"],
+	["keyword", "trying"],
+	["keyword", "understand"],
+	["keyword", "unless"],
+	["keyword", "use"],
+	["keyword", "when"],
+	["keyword", "while"],
+	["keyword", "yes"]
+]
+
+----------------------------------------------------
+
+Checks for keywords.
\ No newline at end of file
diff --git a/tests/languages/inform7/number_feature.test b/tests/languages/inform7/number_feature.test
new file mode 100644
index 0000000..cb5ca7f
--- /dev/null
+++ b/tests/languages/inform7/number_feature.test
@@ -0,0 +1,25 @@
+42
+3.14159
+50kg
+100m
+one two three
+four five six
+seven eight nine
+ten eleven twelve
+
+----------------------------------------------------
+
+[
+	["number", "42"],
+	["number", "3.14159"],
+	["number", "50kg"],
+	["number", "100m"],
+	["number", "one"], ["number", "two"], ["number", "three"],
+	["number", "four"], ["number", "five"], ["number", "six"],
+	["number", "seven"], ["number", "eight"], ["number", "nine"],
+	["number", "ten"], ["number", "eleven"], ["number", "twelve"]
+]
+
+----------------------------------------------------
+
+Checks for numbers.
\ No newline at end of file
diff --git a/tests/languages/inform7/position_feature.test b/tests/languages/inform7/position_feature.test
new file mode 100644
index 0000000..a298217
--- /dev/null
+++ b/tests/languages/inform7/position_feature.test
@@ -0,0 +1,73 @@
+above
+adjacent to
+back side of
+below
+between
+down
+east
+everywhere
+front side
+here
+in
+inside
+inside from
+north
+northeast
+northwest
+nowhere
+on
+on top of
+other side
+outside
+outside from
+part of
+parts of
+regionally in
+south
+southeast
+southwest
+through
+up
+west
+within
+
+----------------------------------------------------
+
+[
+	["position", "above"],
+	["position", "adjacent to"],
+	["position", "back side of"],
+	["position", "below"],
+	["position", "between"],
+	["position", "down"],
+	["position", "east"],
+	["position", "everywhere"],
+	["position", "front side"],
+	["position", "here"],
+	["position", "in"],
+	["position", "inside"],
+	["position", "inside from"],
+	["position", "north"],
+	["position", "northeast"],
+	["position", "northwest"],
+	["position", "nowhere"],
+	["position", "on"],
+	["position", "on top of"],
+	["position", "other side"],
+	["position", "outside"],
+	["position", "outside from"],
+	["position", "part of"],
+	["position", "parts of"],
+	["position", "regionally in"],
+	["position", "south"],
+	["position", "southeast"],
+	["position", "southwest"],
+	["position", "through"],
+	["position", "up"],
+	["position", "west"],
+	["position", "within"]
+]
+
+----------------------------------------------------
+
+Checks for positions.
\ No newline at end of file
diff --git a/tests/languages/inform7/property_feature.test b/tests/languages/inform7/property_feature.test
new file mode 100644
index 0000000..4954b9e
--- /dev/null
+++ b/tests/languages/inform7/property_feature.test
@@ -0,0 +1,157 @@
+adjacent
+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
+lockable
+locked
+male
+marked for listing
+mentioned
+negative
+neuter
+non-empty
+non-full
+non-recurring
+odd
+opaque
+open
+openable
+plural-named
+portable
+positive
+privately-named
+proper-named
+provided
+publically-named
+pushable between rooms
+recurring
+related
+rubbing
+scenery
+seen
+singular-named
+supported
+swinging
+switchable
+switched
+switched on
+switched off
+touchable
+touched
+transparent
+unconcealed
+undescribed
+unlit
+unlocked
+unmarked for listing
+unmentioned
+unopenable
+untouchable
+unvisited
+variable
+visible
+visited
+wearable
+worn
+
+----------------------------------------------------
+
+[
+	["property", "adjacent"],
+	["property", "carried"],
+	["property", "closed"],
+	["property", "concealed"],
+	["property", "contained"],
+	["property", "dark"],
+	["property", "described"],
+	["property", "edible"],
+	["property", "empty"],
+	["property", "enclosed"],
+	["property", "enterable"],
+	["property", "even"],
+	["property", "female"],
+	["property", "fixed in place"],
+	["property", "full"],
+	["property", "handled"],
+	["property", "held"],
+	["property", "improper-named"],
+	["property", "incorporated"],
+	["property", "inedible"],
+	["property", "invisible"],
+	["property", "lighted"],
+	["property", "lit"],
+	["property", "lockable"],
+	["property", "locked"],
+	["property", "male"],
+	["property", "marked for listing"],
+	["property", "mentioned"],
+	["property", "negative"],
+	["property", "neuter"],
+	["property", "non-empty"],
+	["property", "non-full"],
+	["property", "non-recurring"],
+	["property", "odd"],
+	["property", "opaque"],
+	["property", "open"],
+	["property", "openable"],
+	["property", "plural-named"],
+	["property", "portable"],
+	["property", "positive"],
+	["property", "privately-named"],
+	["property", "proper-named"],
+	["property", "provided"],
+	["property", "publically-named"],
+	["property", "pushable between rooms"],
+	["property", "recurring"],
+	["property", "related"],
+	["property", "rubbing"],
+	["property", "scenery"],
+	["property", "seen"],
+	["property", "singular-named"],
+	["property", "supported"],
+	["property", "swinging"],
+	["property", "switchable"],
+	["property", "switched"],
+	["property", "switched on"],
+	["property", "switched off"],
+	["property", "touchable"],
+	["property", "touched"],
+	["property", "transparent"],
+	["property", "unconcealed"],
+	["property", "undescribed"],
+	["property", "unlit"],
+	["property", "unlocked"],
+	["property", "unmarked for listing"],
+	["property", "unmentioned"],
+	["property", "unopenable"],
+	["property", "untouchable"],
+	["property", "unvisited"],
+	["property", "variable"],
+	["property", "visible"],
+	["property", "visited"],
+	["property", "wearable"],
+	["property", "worn"]
+]
+
+----------------------------------------------------
+
+Checks for properties.
\ No newline at end of file
diff --git a/tests/languages/inform7/string_feature.test b/tests/languages/inform7/string_feature.test
new file mode 100644
index 0000000..56a880e
--- /dev/null
+++ b/tests/languages/inform7/string_feature.test
@@ -0,0 +1,49 @@
+""
+"foo"
+"foo
+bar"
+"[if the player is in Center Ring]A magician's booth stands in the corner, painted dark blue with glittering gold stars.[otherwise if the magician's booth is closed]A crack of light indicates the way back out to the center ring.[otherwise]The door stands open to the outside.[end if]"
+
+----------------------------------------------------
+
+[
+	["string", ["\"\""]],
+	["string", ["\"foo\""]],
+	["string", ["\"foo\r\nbar\""]],
+	["string", [
+		"\"",
+		["substitution", [
+			["delimiter", "["],
+			["keyword", "if"], ["text", "the"],
+			["type", "player"], ["verb", "is"],
+			["position", "in"], ["text", "Center Ring"],
+			["delimiter", "]"]
+		]],
+		"A magician's booth stands in the corner, painted dark blue with glittering gold stars.",
+		["substitution", [
+			["delimiter", "["],
+			["keyword", "otherwise"], ["keyword", "if"],
+			["text", "the magician's booth"],
+			["verb", "is"],
+			["property", "closed"],
+			["delimiter", "]"]
+		]],
+		"A crack of light indicates the way back out to the center ring.",
+		["substitution", [
+			["delimiter", "["],
+			["keyword", "otherwise"],
+			["delimiter", "]"]
+		]],
+		"The door stands open to the outside.",
+		["substitution", [
+			["delimiter", "["],
+			["keyword", "end if"],
+			["delimiter", "]"]
+		]],
+		"\""
+	]]
+]
+
+----------------------------------------------------
+
+Checks for strings and text substitution.
\ No newline at end of file
diff --git a/tests/languages/inform7/title_feature.test b/tests/languages/inform7/title_feature.test
new file mode 100644
index 0000000..ec3cdbf
--- /dev/null
+++ b/tests/languages/inform7/title_feature.test
@@ -0,0 +1,21 @@
+Volume 1 - Foobar
+Book 2 - Foobar
+Part 3 - Foobar
+Chapter 4 - Foobar
+Section 5 - Foobar
+Table 6 - Foobar
+
+----------------------------------------------------
+
+[
+	["title", "Volume 1 - Foobar"],
+	["title", "Book 2 - Foobar"],
+	["title", "Part 3 - Foobar"],
+	["title", "Chapter 4 - Foobar"],
+	["title", "Section 5 - Foobar"],
+	["title", "Table 6 - Foobar"]
+]
+
+----------------------------------------------------
+
+Checks for titles.
\ No newline at end of file
diff --git a/tests/languages/inform7/variable_feature.test b/tests/languages/inform7/variable_feature.test
new file mode 100644
index 0000000..25c2f74
--- /dev/null
+++ b/tests/languages/inform7/variable_feature.test
@@ -0,0 +1,141 @@
+action
+actions
+activity
+activities
+actor
+actors
+animal
+animals
+backdrop
+backdrops
+container
+containers
+device
+devices
+direction
+directions
+door
+doors
+holder
+holders
+kind
+kinds
+list
+lists
+man
+men
+nobody
+nothing
+noun
+nouns
+number
+numbers
+object
+objects
+people
+person
+persons
+player
+player's holdall
+region
+regions
+relation
+relations
+room
+rooms
+rule
+rules
+rulebook
+rulebooks
+scene
+scenes
+someone
+something
+supporter
+supporters
+table
+tables
+text
+texts
+thing
+things
+time
+vehicle
+vehicles
+woman
+women
+
+----------------------------------------------------
+
+[
+	["type", "action"],
+	["type", "actions"],
+	["type", "activity"],
+	["type", "activities"],
+	["type", "actor"],
+	["type", "actors"],
+	["type", "animal"],
+	["type", "animals"],
+	["type", "backdrop"],
+	["type", "backdrops"],
+	["type", "container"],
+	["type", "containers"],
+	["type", "device"],
+	["type", "devices"],
+	["type", "direction"],
+	["type", "directions"],
+	["type", "door"],
+	["type", "doors"],
+	["type", "holder"],
+	["type", "holders"],
+	["type", "kind"],
+	["type", "kinds"],
+	["type", "list"],
+	["type", "lists"],
+	["type", "man"],
+	["type", "men"],
+	["type", "nobody"],
+	["type", "nothing"],
+	["type", "noun"],
+	["type", "nouns"],
+	["type", "number"],
+	["type", "numbers"],
+	["type", "object"],
+	["type", "objects"],
+	["type", "people"],
+	["type", "person"],
+	["type", "persons"],
+	["type", "player"],
+	["type", "player's holdall"],
+	["type", "region"],
+	["type", "regions"],
+	["type", "relation"],
+	["type", "relations"],
+	["type", "room"],
+	["type", "rooms"],
+	["type", "rule"],
+	["type", "rules"],
+	["type", "rulebook"],
+	["type", "rulebooks"],
+	["type", "scene"],
+	["type", "scenes"],
+	["type", "someone"],
+	["type", "something"],
+	["type", "supporter"],
+	["type", "supporters"],
+	["type", "table"],
+	["type", "tables"],
+	["type", "text"],
+	["type", "texts"],
+	["type", "thing"],
+	["type", "things"],
+	["type", "time"],
+	["type", "vehicle"],
+	["type", "vehicles"],
+	["type", "woman"],
+	["type", "women"]
+]
+
+----------------------------------------------------
+
+Checks for variables.
\ No newline at end of file
diff --git a/tests/languages/inform7/verb_feature.test b/tests/languages/inform7/verb_feature.test
new file mode 100644
index 0000000..3da285d
--- /dev/null
+++ b/tests/languages/inform7/verb_feature.test
@@ -0,0 +1,213 @@
+applying to
+are
+attacking
+answering
+asking
+be
+being
+burning
+buying
+called
+carries
+carry
+carrying
+climbing
+closing
+conceal
+conceals
+concealing
+consulting
+contain
+contains
+containing
+cutting
+drinking
+dropping
+eating
+enclose
+encloses
+enclosing
+entering
+examining
+exiting
+getting
+giving
+going
+have
+has
+having
+hold
+holds
+holding
+imply
+implies
+incorporate
+incorporates
+incorporating
+inserting
+is
+jumping
+kissing
+listening
+locking
+looking
+mean
+means
+meaning
+opening
+provide
+provides
+providing
+pulling
+pushing
+putting
+relate
+relates
+relating
+removing
+searching
+see
+sees
+seeing
+setting
+showing
+singing
+sleeping
+smelling
+squeezing
+switching
+support
+supports
+supporting
+swearing
+taking
+tasting
+telling
+thinking
+throwing
+touching
+turning
+tying
+unlock
+unlocks
+unlocking
+vary
+varies
+varying
+waiting
+waking
+waving
+wear
+wears
+wearing
+
+----------------------------------------------------
+
+[
+	["verb", "applying to"],
+	["verb", "are"],
+	["verb", "attacking"],
+	["verb", "answering"],
+	["verb", "asking"],
+	["verb", "be"],
+	["verb", "being"],
+	["verb", "burning"],
+	["verb", "buying"],
+	["verb", "called"],
+	["verb", "carries"],
+	["verb", "carry"],
+	["verb", "carrying"],
+	["verb", "climbing"],
+	["verb", "closing"],
+	["verb", "conceal"],
+	["verb", "conceals"],
+	["verb", "concealing"],
+	["verb", "consulting"],
+	["verb", "contain"],
+	["verb", "contains"],
+	["verb", "containing"],
+	["verb", "cutting"],
+	["verb", "drinking"],
+	["verb", "dropping"],
+	["verb", "eating"],
+	["verb", "enclose"],
+	["verb", "encloses"],
+	["verb", "enclosing"],
+	["verb", "entering"],
+	["verb", "examining"],
+	["verb", "exiting"],
+	["verb", "getting"],
+	["verb", "giving"],
+	["verb", "going"],
+	["verb", "have"],
+	["verb", "has"],
+	["verb", "having"],
+	["verb", "hold"],
+	["verb", "holds"],
+	["verb", "holding"],
+	["verb", "imply"],
+	["verb", "implies"],
+	["verb", "incorporate"],
+	["verb", "incorporates"],
+	["verb", "incorporating"],
+	["verb", "inserting"],
+	["verb", "is"],
+	["verb", "jumping"],
+	["verb", "kissing"],
+	["verb", "listening"],
+	["verb", "locking"],
+	["verb", "looking"],
+	["verb", "mean"],
+	["verb", "means"],
+	["verb", "meaning"],
+	["verb", "opening"],
+	["verb", "provide"],
+	["verb", "provides"],
+	["verb", "providing"],
+	["verb", "pulling"],
+	["verb", "pushing"],
+	["verb", "putting"],
+	["verb", "relate"],
+	["verb", "relates"],
+	["verb", "relating"],
+	["verb", "removing"],
+	["verb", "searching"],
+	["verb", "see"],
+	["verb", "sees"],
+	["verb", "seeing"],
+	["verb", "setting"],
+	["verb", "showing"],
+	["verb", "singing"],
+	["verb", "sleeping"],
+	["verb", "smelling"],
+	["verb", "squeezing"],
+	["verb", "switching"],
+	["verb", "support"],
+	["verb", "supports"],
+	["verb", "supporting"],
+	["verb", "swearing"],
+	["verb", "taking"],
+	["verb", "tasting"],
+	["verb", "telling"],
+	["verb", "thinking"],
+	["verb", "throwing"],
+	["verb", "touching"],
+	["verb", "turning"],
+	["verb", "tying"],
+	["verb", "unlock"],
+	["verb", "unlocks"],
+	["verb", "unlocking"],
+	["verb", "vary"],
+	["verb", "varies"],
+	["verb", "varying"],
+	["verb", "waiting"],
+	["verb", "waking"],
+	["verb", "waving"],
+	["verb", "wear"],
+	["verb", "wears"],
+	["verb", "wearing"]
+]
+
+----------------------------------------------------
+
+Checks for verbs.
\ No newline at end of file