diff options
Diffstat (limited to 'tests/lexers/scheme/example2.txt')
| -rw-r--r-- | tests/lexers/scheme/example2.txt | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/lexers/scheme/example2.txt b/tests/lexers/scheme/example2.txt new file mode 100644 index 00000000..c63e7061 --- /dev/null +++ b/tests/lexers/scheme/example2.txt @@ -0,0 +1,83 @@ +---input--- +#!r6rs + +#| + + The FACT procedure computes the factorial + + of a non-negative integer. + +|# + +(define fact + + (lambda (n) + + ;; base case + + (if (= n 0) + + #;(= n 1) + + 1 ; identity of * + + (* n (fact (- n 1)))))) + +---tokens--- +'#!r6rs' Comment +'\n\n' Text + +'#|' Comment.Multiline +'\n\n The FACT procedure computes the factorial\n\n of a non-negative integer.\n\n' Comment.Multiline + +'|#' Comment.Multiline +'\n\n' Text + +'(' Punctuation +'define ' Keyword +'fact' Name.Variable +'\n\n ' Text +'(' Punctuation +'lambda ' Keyword +'(' Punctuation +'n' Name.Function +')' Punctuation +'\n\n ' Text +';; base case' Comment.Single +'\n\n ' Text +'(' Punctuation +'if ' Keyword +'(' Punctuation +'= ' Name.Builtin +'n' Name.Variable +' ' Text +'0' Literal.Number.Integer +')' Punctuation +'\n\n ' Text +'#;(' Comment +'= n 1' Comment +')' Comment +'\n\n ' Text +'1' Literal.Number.Integer +' ' Text +'; identity of *' Comment.Single +'\n\n ' Text +'(' Punctuation +'* ' Name.Builtin +'n' Name.Variable +' ' Text +'(' Punctuation +'fact' Name.Function +' ' Text +'(' Punctuation +'- ' Name.Builtin +'n' Name.Variable +' ' Text +'1' Literal.Number.Integer +')' Punctuation +')' Punctuation +')' Punctuation +')' Punctuation +')' Punctuation +')' Punctuation +'\n' Text |
