diff --git a/.gitmodules b/.gitmodules index c776f0b2..587ae6cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,9 +25,6 @@ [submodule "vendor/grammars/Sublime-REBOL"] path = vendor/grammars/Sublime-REBOL url = https://github.com/Oldes/Sublime-REBOL -[submodule "vendor/grammars/Sublime-Inform"] - path = vendor/grammars/Sublime-Inform - url = https://github.com/PogiNate/Sublime-Inform [submodule "vendor/grammars/autoitv3-tmbundle"] path = vendor/grammars/autoitv3-tmbundle url = https://github.com/Red-Nova-Technologies/autoitv3-tmbundle @@ -704,6 +701,9 @@ [submodule "vendor/grammars/language-renpy"] path = vendor/grammars/language-renpy url = https://github.com/williamd1k0/language-renpy.git +[submodule "vendor/grammars/language-inform7"] + path = vendor/grammars/language-inform7 + url = https://github.com/erkyrath/language-inform7 [submodule "vendor/grammars/atom-language-stan"] path = vendor/grammars/atom-language-stan url = git@github.com:jrnold/atom-language-stan.git diff --git a/grammars.yml b/grammars.yml index 2b7b5c8d..c8de7b72 100644 --- a/grammars.yml +++ b/grammars.yml @@ -106,8 +106,6 @@ vendor/grammars/Sublime-Coq: - source.coq vendor/grammars/Sublime-HTTP: - source.httpspec -vendor/grammars/Sublime-Inform: -- source.Inform7 vendor/grammars/Sublime-Lasso: - file.lasso vendor/grammars/Sublime-Logos: @@ -347,6 +345,8 @@ vendor/grammars/language-gfm: - source.gfm vendor/grammars/language-hy: - source.hy +vendor/grammars/language-inform7: +- source.inform7 vendor/grammars/language-javascript: - source.js - source.js.regexp diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 3575041a..fe3ed9aa 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1510,7 +1510,7 @@ Inform 7: extensions: - .ni - .i7x - tm_scope: source.Inform7 + tm_scope: source.inform7 aliases: - i7 - inform7 diff --git a/samples/Inform 7/Trivial Extension.i7x b/samples/Inform 7/Trivial Extension.i7x index 1aae1b85..40f53dab 100644 --- a/samples/Inform 7/Trivial Extension.i7x +++ b/samples/Inform 7/Trivial Extension.i7x @@ -1,6 +1,74 @@ -Version 1 of Trivial Extension by Andrew Plotkin begins here. +Version 2 of Trivial Extension by Andrew Plotkin begins here. + +"This is the rubric of the extension." + +"provided for the Linguist package by Andrew Plotkin" + +[Note the two special quoted lines above.] A cow is a kind of animal. A cow can be purple. +Understand "cow" as a cow. +Understand "purple" as a purple cow. + +Check pushing a cow: + instead say "Cow-tipping, at your age?[paragraph break]Inconceivable." + +[Here are the possible levels of heading:] + +Volume One + +Text-line is always "A line of text." + +Book 2 + + Part the third - indented headings still count + +Chapter IV - not for release + +[Heading labels are case-insensitive.] + +section foobar + +[A line beginning "Volume" that does not have blank lines before and after it is *not* a header line. So the following should all be part of section foobar. Sadly, the "Volume is..." line gets colored as a header, because Atom's regexp model can't recognize "thing with blank lines before and after"!] + +Measure is a kind of value. +Volume is a measure. Length is a measure. +Area is a measure. + +[And now some Inform 6 inclusions.] + +To say em -- running on: + (- style underline; -). +To say /em -- running on: + (- style roman; -). + +Include (- + +! Inform 6 comments start with a ! mark and run to the end of the line. +Global cowcount; + +[ inform6func arg; + print "Here is some text; ", (address) 'dictword', ".^"; + cowcount++; ! increment this variable +]; + +Object i6cow + with name 'cow' 'animal', + with description "It looks like a cow.", + has animate scenery; + +-) after "Global Variables" in "Output.i6t". + Trivial Extension ends here. +---- DOCUMENTATION ---- + +Everything after the "---- DOCUMENTATION ----" line is documentation, so it should have the comment style. + +However, tab-indented lines are sample Inform code within the documentation: + + Horns are a kind of thing. Every cow has horns. + say "Moo[if the noun is purple] indigo[end if]." + +So we need to allow for that. diff --git a/samples/Inform 7/story.ni b/samples/Inform 7/story.ni index f8873369..4fd774b5 100644 --- a/samples/Inform 7/story.ni +++ b/samples/Inform 7/story.ni @@ -2,11 +2,61 @@ Include Trivial Extension by Andrew Plotkin. +Volume 1 - overview + +Chapter - setting the scene + The Kitchen is a room. -[This kitchen is modelled after the one in Zork, although it lacks the detail to establish this to the player.] +[Comment: this kitchen is modelled after the one in Zork, although it lacks the detail to establish this to the player.] + +Section - the kitchen table + +The spicerack is a container in the Kitchen. + +Table of Spices +Name Flavor +"cinnamon" 5 +"nutmeg" 4 +"szechuan pepper" 8 + +The description of the spicerack is "It's mostly empty." + +Chapter - a character A purple cow called Gelett is in the Kitchen. +[This comment spans multiple lines.. + +...and this line contains [nested square[] brackets]... + +...which is legal in Inform 7.] + Instead of examining Gelett: say "You'd rather see than be one." + +Instead of examining Gelett: + say "You'd rather see than be one." + +Check smelling Gelett: + say "This text contains several lines. + +A blank line is displayed as a paragraph break, +but a simple line break is not."; + stop the action. + +Section - cow catching + +Gelett has a number called the mooness. + +Instead of taking Gelett: + increment the mooness of Gelett; + if the mooness of Gelett is one: + say "Gelett moos once."; + else: + say "Gelett moos [mooness of Gelett in words] times."; + +Volume 2 - the turn cycle + +Every turn: + say "A turn passes[one of][or] placidly[or] idly[or] tediously[at random]." diff --git a/vendor/grammars/Sublime-Inform b/vendor/grammars/Sublime-Inform deleted file mode 160000 index 8db129b8..00000000 --- a/vendor/grammars/Sublime-Inform +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8db129b8389044a6660ca232566651c8fe3ab646 diff --git a/vendor/grammars/language-inform7 b/vendor/grammars/language-inform7 new file mode 160000 index 00000000..b953a1ef --- /dev/null +++ b/vendor/grammars/language-inform7 @@ -0,0 +1 @@ +Subproject commit b953a1efedcff21091ba3b7e7fbcd1040c1f02bb