summaryrefslogtreecommitdiff
path: root/tests/lexers/prolog/example.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/prolog/example.txt')
-rw-r--r--tests/lexers/prolog/example.txt181
1 files changed, 181 insertions, 0 deletions
diff --git a/tests/lexers/prolog/example.txt b/tests/lexers/prolog/example.txt
new file mode 100644
index 00000000..13e2cb1f
--- /dev/null
+++ b/tests/lexers/prolog/example.txt
@@ -0,0 +1,181 @@
+---input---
+partition([], _, [], []).
+partition([X|Xs], Pivot, Smalls, Bigs) :-
+ ( X @< Pivot ->
+ Smalls = [X|Rest],
+ partition(Xs, Pivot, Rest, Bigs)
+ ; Bigs = [X|Rest],
+ partition(Xs, Pivot, Smalls, Rest)
+ ).
+
+quicksort([]) --> [].
+quicksort([X|Xs]) -->
+ { partition(Xs, X, Smaller, Bigger) },
+ quicksort(Smaller), [X], quicksort(Bigger).
+
+---tokens---
+'partition' Name.Function
+'(' Punctuation
+'[' Punctuation
+']' Punctuation
+',' Punctuation
+' ' Text
+'_' Keyword
+',' Punctuation
+' ' Text
+'[' Punctuation
+']' Punctuation
+',' Punctuation
+' ' Text
+'[' Punctuation
+']' Punctuation
+')' Punctuation
+'.' Punctuation
+'\n' Text
+
+'partition' Name.Function
+'(' Punctuation
+'[' Punctuation
+'X' Name.Variable
+'|' Punctuation
+'Xs' Name.Variable
+']' Punctuation
+',' Punctuation
+' ' Text
+'Pivot' Name.Variable
+',' Punctuation
+' ' Text
+'Smalls' Name.Variable
+',' Punctuation
+' ' Text
+'Bigs' Name.Variable
+')' Punctuation
+' ' Text
+':-' Punctuation
+'\n ' Text
+'(' Punctuation
+' ' Text
+'X' Name.Variable
+' ' Text
+'@<' Literal.String.Atom
+' ' Text
+'Pivot' Name.Variable
+' ' Text
+'->' Literal.String.Atom
+'\n ' Text
+'Smalls' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+'[' Punctuation
+'X' Name.Variable
+'|' Punctuation
+'Rest' Name.Variable
+']' Punctuation
+',' Punctuation
+'\n ' Text
+'partition' Name.Function
+'(' Punctuation
+'Xs' Name.Variable
+',' Punctuation
+' ' Text
+'Pivot' Name.Variable
+',' Punctuation
+' ' Text
+'Rest' Name.Variable
+',' Punctuation
+' ' Text
+'Bigs' Name.Variable
+')' Punctuation
+'\n ' Text
+';' Punctuation
+' ' Text
+'Bigs' Name.Variable
+' ' Text
+'=' Operator
+' ' Text
+'[' Punctuation
+'X' Name.Variable
+'|' Punctuation
+'Rest' Name.Variable
+']' Punctuation
+',' Punctuation
+'\n ' Text
+'partition' Name.Function
+'(' Punctuation
+'Xs' Name.Variable
+',' Punctuation
+' ' Text
+'Pivot' Name.Variable
+',' Punctuation
+' ' Text
+'Smalls' Name.Variable
+',' Punctuation
+' ' Text
+'Rest' Name.Variable
+')' Punctuation
+'\n ' Text
+')' Punctuation
+'.' Punctuation
+'\n\n' Text
+
+'quicksort' Name.Function
+'(' Punctuation
+'[' Punctuation
+']' Punctuation
+')' Punctuation
+' ' Text
+'-->' Punctuation
+' ' Text
+'[' Punctuation
+']' Punctuation
+'.' Punctuation
+'\n' Text
+
+'quicksort' Name.Function
+'(' Punctuation
+'[' Punctuation
+'X' Name.Variable
+'|' Punctuation
+'Xs' Name.Variable
+']' Punctuation
+')' Punctuation
+' ' Text
+'-->' Punctuation
+' \n ' Text
+'{' Punctuation
+' ' Text
+'partition' Name.Function
+'(' Punctuation
+'Xs' Name.Variable
+',' Punctuation
+' ' Text
+'X' Name.Variable
+',' Punctuation
+' ' Text
+'Smaller' Name.Variable
+',' Punctuation
+' ' Text
+'Bigger' Name.Variable
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n ' Text
+'quicksort' Name.Function
+'(' Punctuation
+'Smaller' Name.Variable
+')' Punctuation
+',' Punctuation
+' ' Text
+'[' Punctuation
+'X' Name.Variable
+']' Punctuation
+',' Punctuation
+' ' Text
+'quicksort' Name.Function
+'(' Punctuation
+'Bigger' Name.Variable
+')' Punctuation
+'.' Punctuation
+'\n' Text