summaryrefslogtreecommitdiff
path: root/tests/lexers/inform7
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/inform7
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/inform7')
-rw-r--r--tests/lexers/inform7/example.txt356
-rw-r--r--tests/lexers/inform7/example2.txt226
2 files changed, 582 insertions, 0 deletions
diff --git a/tests/lexers/inform7/example.txt b/tests/lexers/inform7/example.txt
new file mode 100644
index 00000000..6bafb164
--- /dev/null
+++ b/tests/lexers/inform7/example.txt
@@ -0,0 +1,356 @@
+---input---
+ | | |
+"Informal by Nature"
+[ * * * ]
+by
+[ * * * ]
+David Corbett
+
+[This is a [nested] comment.]
+
+Section 1 - Use option translation
+
+Use maximum tests of at least 100 translates as (-
+@c
+Constant MAX_TESTS = {N}; —). | Section 2
+
+A room has a number called size.
+
+The Kitchen is a room. "A nondescript kitchen.“ The Kitchen has size 2.
+
+When play begins:
+ say "Testing:[line break]";
+ test 0.
+
+To test (N — number): (—
+ if (Test({N}) == (+size of the Kitchen [this should succeed]+)) {-open—brace}
+ print ”Success.^”;
+ {-close-brace} else {
+ print “Failure.^";
+ }
+]; ! You shouldn't end a routine within a phrase definition, but it works.
+[ Unused;
+ #Include "\
+@p \
+"; ! At signs hold no power here.
+! Of course, the file "@p .h" must exist.
+-).
+
+Include (-!% This is not ICL.
+
+[ Test x;
+ if (x) {x++;}
+ {–! Single line comment.}
+@inc x;
+@p At signs.
+...
+@Purpose: ...
+...
+@-...
+@c ...
+@inc x;
+@c
+@c
+ return x;
+];
+@Purpose: ...
+@-------------------------------------------------------------------------------
+-).
+
+---tokens---
+' | | |\n' Text
+
+'"' Generic.Heading
+'Informal by Nature' Generic.Heading
+'"' Generic.Heading
+'\n' Generic.Heading
+
+'[' Comment.Multiline
+' * * * ' Comment.Multiline
+']' Comment.Multiline
+'\n' Generic.Heading
+
+'by' Generic.Heading
+'\n' Generic.Heading
+
+'[' Comment.Multiline
+' * * * ' Comment.Multiline
+']' Comment.Multiline
+'\n' Generic.Heading
+
+'David Corbett' Generic.Heading
+'\n\n' Text
+
+'[' Comment.Multiline
+'This is a ' Comment.Multiline
+'[' Comment.Multiline
+'nested' Comment.Multiline
+']' Comment.Multiline
+' comment.' Comment.Multiline
+']' Comment.Multiline
+'\n\n' Text
+
+'Section 1 - Use option translation' Generic.Heading
+'\n\n' Text
+
+'Use m' Text
+'a' Text
+'ximum tests of ' Text
+'a' Text
+'t le' Text
+'a' Text
+'st 100 tr' Text
+'a' Text
+'nsl' Text
+'a' Text
+'tes ' Text
+'as' Text
+' ' Text
+'(-' Punctuation
+'\n' Text
+
+'@c\n' Comment.Preproc
+
+'Constant' Keyword
+' ' Text
+'MAX_TESTS' Name.Constant
+' ' Text
+'=' Operator
+' ' Text
+'' Text
+'{' Punctuation
+'N' Text
+'}' Punctuation
+'' Punctuation
+';' Punctuation
+' ' Text
+'—)' Punctuation
+'. ' Text
+'| ' Text
+'Section 2' Generic.Heading
+'\n\n' Text
+
+'A' Text
+' room h' Text
+'a' Text
+'s ' Text
+'a' Text
+' number c' Text
+'a' Text
+'lled size.' Text
+'\n\n' Text
+
+'The Kitchen is ' Text
+'a' Text
+' room. ' Text
+'"' Literal.String.Double
+'A nondescript kitchen.' Literal.String.Double
+'“' Literal.String.Double
+' The Kitchen h' Text
+'a' Text
+'s size 2.' Text
+'\n\n' Text
+
+'When pl' Text
+'a' Text
+'y begins' Text
+':' Text
+'\n\t' Text
+'s' Text
+'a' Text
+'y ' Text
+'"' Literal.String.Double
+'Testing:' Literal.String.Double
+'[line break]' Literal.String.Interpol
+'"' Literal.String.Double
+';' Text
+'\n' Text
+
+'\ttest 0.' Text
+'\n\n' Text
+
+'To test ' Text
+'(' Text
+'N — number)' Text
+':' Text
+' ' Text
+'(—' Punctuation
+'\n\t' Text
+'if' Keyword
+' ' Text
+'(' Punctuation
+'' Text
+'Test' Name
+'(' Punctuation
+'' Text
+'{' Punctuation
+'N' Text
+'}' Punctuation
+')' Punctuation
+' ' Text
+'==' Operator
+' ' Text
+'' Text
+'(+' Punctuation
+'size of the Kitchen ' Text
+'[' Comment.Multiline
+'this should succeed' Comment.Multiline
+']' Comment.Multiline
+'+)' Punctuation
+')' Punctuation
+' ' Text
+'{-' Punctuation
+'open—brace' Keyword
+'}' Punctuation
+'\n\t\t' Text
+'print' Keyword
+' ' Text
+'' Text
+'”' Literal.String.Double
+'Success.' Literal.String.Double
+'^' Literal.String.Escape
+'”' Literal.String.Double
+';' Punctuation
+'\n\t' Text
+'{-' Punctuation
+'close-brace' Keyword
+'}' Punctuation
+' ' Text
+'else' Keyword
+' ' Text
+'{' Punctuation
+'\n\t\t' Text
+'print' Keyword
+' ' Text
+'' Text
+'“' Literal.String.Double
+'Failure.' Literal.String.Double
+'^' Literal.String.Escape
+'"' Literal.String.Double
+';' Punctuation
+'\n\t' Text
+'}' Punctuation
+'\n' Text
+
+']' Punctuation
+'' Punctuation
+';' Punctuation
+' ' Text
+"! You shouldn't end a routine within a phrase definition, but it works." Comment.Single
+'\n' Text
+
+'[' Punctuation
+' ' Text
+'Unused' Name.Function
+';' Punctuation
+'\n\t' Text
+'#' Punctuation
+'Include' Keyword
+' ' Text
+'"' Literal.String.Double
+'\\' Literal.String.Escape
+'\n@p ' Literal.String.Double
+'\\' Literal.String.Escape
+'\n' Literal.String.Double
+
+'"' Literal.String.Double
+'' Punctuation
+';' Punctuation
+' ' Text
+'! At signs hold no power here.' Comment.Single
+'\n' Text
+
+'! Of course, the file "@p .h" must exist.' Comment.Single
+'\n' Text
+
+'-)' Punctuation
+'.' Text
+'\n\n' Text
+
+'Include ' Text
+'(-' Punctuation
+'!% This is not ICL.' Comment.Single
+'\n\n' Text
+
+'[' Punctuation
+' ' Text
+'Test' Name.Function
+' ' Text
+'x' Name.Variable
+';' Punctuation
+'\n\t' Text
+'if' Keyword
+' ' Text
+'(' Punctuation
+'' Text
+'x' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'' Text
+'x' Name
+'++' Operator
+'' Punctuation
+';' Punctuation
+'}' Punctuation
+'\n\t' Text
+'{–' Punctuation
+'! Single line comment.' Comment.Single
+'}' Punctuation
+'\n' Text
+
+'@' Keyword
+'inc' Keyword
+' ' Text
+'' Text
+'x' Name
+';' Punctuation
+'\n' Text
+
+'@p At signs.\n' Generic.Heading
+
+'...\n' Comment.Preproc
+
+'@Purpose:' Comment.Preproc
+' ...\n...\n' Comment.Preproc
+
+'@-' Comment.Preproc
+'...\n' Comment.Preproc
+
+'@c ...\n' Comment.Preproc
+
+'@' Keyword
+'inc' Keyword
+' ' Text
+'' Text
+'x' Name
+';' Punctuation
+'\n' Text
+
+'@c\n' Comment.Preproc
+
+'@c\n' Comment.Preproc
+
+'\t' Text
+'return' Keyword
+' ' Text
+'' Text
+'x' Name
+'' Punctuation
+';' Punctuation
+'\n' Text
+
+']' Punctuation
+'' Punctuation
+';' Punctuation
+'\n' Text
+
+'@Purpose: ...' Comment.Preproc
+'\n' Text
+
+'@-------------------------------------------------------------------------------' Comment.Preproc
+'\n' Text
+
+'-)' Punctuation
+'.' Text
+'\n' Text
diff --git a/tests/lexers/inform7/example2.txt b/tests/lexers/inform7/example2.txt
new file mode 100644
index 00000000..b2048384
--- /dev/null
+++ b/tests/lexers/inform7/example2.txt
@@ -0,0 +1,226 @@
+---input---
+example by David Corbett begins here.
+
+"Implements testable examples."
+
+An example is a kind of thing. An example can be tested. An example is seldom tested.
+
+example ends here.
+
+----
+[The] documentation [starts here.]
+----
+
+This extension adds examples, which may be tested.
+
+Chapter: Usage
+
+To add an example to the story, we write:
+
+ The foobar is an example.
+
+To interact with it in Inform 6, we write something like:
+
+ To say (E - example): (-
+ print (object) {E};
+ -).
+ [The IDE's documentation viewer does not display the closing -). I don't know how to fix that.]
+
+Section: Testing
+
+We can make an example be tested using:
+
+ now the foobar is tested;
+
+Example: * Exempli Gratia - A simple example.
+
+ *: "Exempli Gratia"
+
+ Include example by David Corbett.
+
+ The Kitchen is a room. The egg is an example, here.
+
+ Before dropping the egg:
+ now the egg is tested.
+
+ Test me with "get egg / drop egg".
+
+---tokens---
+'ex' Text
+'a' Text
+'mple by D' Text
+'a' Text
+'vid Corbett begins here.' Text
+'\n\n' Text
+
+'"' Literal.String.Double
+'Implements testable examples.' Literal.String.Double
+'"' Literal.String.Double
+'\n\n' Text
+
+'A' Text
+'n ex' Text
+'a' Text
+'mple is ' Text
+'a' Text
+' kind of thing. ' Text
+'A' Text
+'n ex' Text
+'a' Text
+'mple c' Text
+'a' Text
+'n be tested. ' Text
+'A' Text
+'n ex' Text
+'a' Text
+'mple is seldom tested.' Text
+'\n\n' Text
+
+'ex' Text
+'a' Text
+'mple ends here.' Text
+'\n\n' Text
+
+'----\n' Text
+
+'[' Comment.Multiline
+'The' Comment.Multiline
+']' Comment.Multiline
+' ' Text
+'documentation ' Text
+'[' Comment.Multiline
+'starts here.' Comment.Multiline
+']' Comment.Multiline
+'\n' Text
+
+'----\n' Text
+
+'\n' Text
+
+'This extension adds examples, which may be tested.' Text
+'\n' Text
+
+'\nChapter: Usage' Generic.Heading
+'\n' Text
+
+'\n' Text
+
+'To add an example to the story, we write:' Text
+'\n' Text
+
+'\n' Text
+
+'\tThe foob' Text
+'a' Text
+'r is ' Text
+'a' Text
+'n ex' Text
+'a' Text
+'mple.' Text
+'\n' Text
+
+'\n' Text
+
+'To interact with it in Inform 6, we write something like:' Text
+'\n' Text
+
+'\n' Text
+
+'\tTo s' Text
+'a' Text
+'y ' Text
+'(' Text
+'E - ex' Text
+'a' Text
+'mple)' Text
+':' Text
+' ' Text
+'(-' Punctuation
+'\n\t\t' Text
+'print' Keyword
+' ' Text
+'(' Punctuation
+'object' Keyword.Pseudo
+')' Punctuation
+' ' Text
+'' Text
+'{' Punctuation
+'E' Text
+'}' Punctuation
+';' Punctuation
+'\n\t' Text
+'-)' Punctuation
+'.' Text
+'\n' Text
+
+'\t' Text
+'[' Comment.Multiline
+"The IDE's documentation viewer does not display the closing -). I don't know how to fix that." Comment.Multiline
+']' Comment.Multiline
+'\n' Text
+
+'\nSection: Testing' Generic.Subheading
+'\n' Text
+
+'\n' Text
+
+'We can make an example be tested using:' Text
+'\n' Text
+
+'\n' Text
+
+'\tnow the foob' Text
+'a' Text
+'r is tested;' Text
+'\n' Text
+
+'\nExample: * Exempli Gratia - A simple example.' Generic.Heading
+'\n' Text
+
+'\n' Text
+
+'\t*' Text
+':' Text
+' ' Text
+'"' Literal.String.Double
+'Exempli Gratia' Literal.String.Double
+'"' Literal.String.Double
+'\n' Text
+
+'\n' Text
+
+'\tInclude ex' Text
+'a' Text
+'mple by D' Text
+'a' Text
+'vid Corbett.' Text
+'\n' Text
+
+'\n' Text
+
+'\tThe Kitchen is ' Text
+'a' Text
+' room. The egg is ' Text
+'a' Text
+'n ex' Text
+'a' Text
+'mple, here.' Text
+'\n' Text
+
+'\n' Text
+
+'\tBefore dropping the egg' Text
+':' Text
+'\n\t\t' Text
+'now the egg is tested.' Text
+'\n' Text
+
+'\t' Text
+'\n' Text
+
+'\tTest me with ' Text
+'"' Literal.String.Double
+'get egg / drop egg' Literal.String.Double
+'"' Literal.String.Double
+'.' Text
+'\n' Text