summaryrefslogtreecommitdiff
path: root/tests/lexers/logos
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/logos
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/logos')
-rw-r--r--tests/lexers/logos/example.txt183
1 files changed, 183 insertions, 0 deletions
diff --git a/tests/lexers/logos/example.txt b/tests/lexers/logos/example.txt
new file mode 100644
index 00000000..aa59bf27
--- /dev/null
+++ b/tests/lexers/logos/example.txt
@@ -0,0 +1,183 @@
+---input---
+%hook ABC
+- (id)a:(B)b {
+ %log;
+ return %orig(nil);
+}
+%end
+
+%subclass DEF: NSObject
+- (id)init {
+ [%c(RuntimeAccessibleClass) alloc];
+ return nil;
+}
+%end
+
+%group OptionalHooks
+%hook ABC
+- (void)release {
+ [self retain];
+ %orig;
+}
+%end
+%end
+
+%ctor {
+ %init;
+ if(OptionalCondition)
+ %init(OptionalHooks);
+}
+
+---tokens---
+'%hook' Keyword
+' ' Text
+'ABC' Name.Class
+'\n' Text
+
+'-' Punctuation
+' ' Text
+'(' Punctuation
+'id' Keyword.Type
+')' Punctuation
+'a:' Name.Function
+'(' Punctuation
+'B' Name
+')' Punctuation
+'b' Name.Variable
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'\t' Text
+'%log' Keyword
+';' Punctuation
+'\n' Text
+
+'\t' Text
+'return' Keyword
+' ' Text
+'%orig' Keyword
+'(' Punctuation
+'nil' Name.Builtin
+')' Punctuation
+';' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'%end' Keyword
+'\n\n' Text
+
+'%subclass' Keyword
+' ' Text
+'DEF' Name.Class
+': ' Text
+'NSObject' Name.Builtin.Pseudo
+'\n' Text
+
+'-' Punctuation
+' ' Text
+'(' Punctuation
+'id' Keyword.Type
+')' Punctuation
+'init' Name.Function
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'\t' Text
+'[' Punctuation
+'%c' Keyword
+'(' Punctuation
+'RuntimeAccessibleClass' Name.Class
+')' Punctuation
+' ' Text
+'alloc' Name
+']' Punctuation
+';' Punctuation
+'\n' Text
+
+'\t' Text
+'return' Keyword
+' ' Text
+'nil' Name.Builtin
+';' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'%end' Keyword
+'\n\n' Text
+
+'%group' Keyword
+' ' Text
+'OptionalHooks' Name.Class
+'\n' Text
+
+'%hook' Keyword
+' ' Text
+'ABC' Name.Class
+'\n' Text
+
+'-' Punctuation
+' ' Text
+'(' Punctuation
+'void' Keyword.Type
+')' Punctuation
+'release' Name.Function
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'\t' Text
+'[' Punctuation
+'self' Name.Builtin
+' ' Text
+'retain' Keyword
+']' Punctuation
+';' Punctuation
+'\n' Text
+
+'\t' Text
+'%orig' Keyword
+';' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
+
+'%end' Keyword
+'\n' Text
+
+'%end' Keyword
+'\n\n' Text
+
+'%ctor' Keyword
+' ' Text
+'{' Punctuation
+'\n' Text
+
+'\t' Text
+'%init' Keyword
+';' Punctuation
+'\n' Text
+
+'\t' Text
+'if' Keyword
+'(' Punctuation
+'OptionalCondition' Name
+')' Punctuation
+'\n' Text
+
+'\t\t' Text
+'%init' Keyword
+'(' Punctuation
+'OptionalHooks' Name.Class
+')' Punctuation
+';' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text