content: ;;; -*- mode: finkel -*-
  ;;;
  ;;; Tests for tokens and literal values. Unlike Haskell, lines starting
  ;;; with `;' are comments. This file intentionally contain spaces and
  ;;; tabs.
  
  (module Main)
  
  (= main
    (do
      ;; 2.5 Numeric Literals
  
      ;; Literal integers.
      (print 42)
      (print -24)
      (print 0x123abcdef)
      (print -0xdeadbeaf)
      (print 0o7654321)
      (print -0o7777)
  
      ;; Fractional number.
      (print 1.234567)
      (print -8.9)
  
      ;; 2.6 Character and String Literals.
      (print #'a) (print #'0) (print #'+) (print #'')
      (print #')) (print #'[) (print #';) (print #'\)
      (print #'犬) (print #'Я) (print #'λ) (print #'👺)
  
      (print #'\29356) (print #'\1071) (print #'\955) (print #'\128122)
      (print #'\o71254) (print #'\o2057) (print #'\o1673) (print #'\o372172)
      (print #'\x72ac) (print #'\x42f) (print #'\x3bb) (print #'\x1f47a)
  
      (putChar #'\a)               ; alert
      (putChar #'\SP)              ; space
      (putChar #'\b)               ; backspace
      (putChar #'\HT)              ; horizontal tab
      (putChar #'\n)               ; new line
      (putChar #'\NUL)             ; \NUL
      (putChar #'\LF)              ; line feed
  
      (putChar #'\FF)              ; form feed
      (putChar #'\^L)              ; form feed with control char
  
      ;; Single element String with escaped character.
      (putStrLn [#'\35])
  
      (putStrLn "string literal") ; Simple string
  
      ;; String containing escaped `"'.
      (putStrLn "string with \"double quotes\".")
  
      ;; String containing escaped newlines and tabs.
      (putStrLn "string with newlines: \n\n\nand tabs: \t\t\t.")
  
      ;; Strings with non-ASCII characters.
      (putStrLn "᚛᚛ᚉᚑᚅᚔᚉᚉᚔᚋ ᚔᚈᚔ ᚍᚂᚐᚅᚑ ᚅᚔᚋᚌᚓᚅᚐ᚜")
      (putStrLn "ᛁᚳ᛫ᛗᚨᚷ᛫ᚷᛚᚨᛋ᛫ᛖᚩᛏᚪᚾ᛫ᚩᚾᛞ᛫ᚻᛁᛏ᛫ᚾᛖ᛫ᚻᛖᚪᚱᛗᛁᚪᚧ᛫ᛗᛖ᛬")
      (putStrLn "私はガラスを食べられます。それは私を傷つけません。")
  
      ;; String gap
      (putStrLn "Here is a backslant \\ as well as \137, \
  \a numeric escape character, and \^X, a control character.")
  
      ;; Empty string.
      (putStrLn "")
  
      ;; Unit.
      (print ())
  
      ;; List literals.
      (print [1 2 3 4 5])
      (print (: True (: False [])))
  
      ;; List containing expressions.
      (print [(if (> 2 3)
                  (do (<- x (return 100))
                      (<- y (return 23))
                      (return (+ x y)))
                  (return 123))
              (Left "foo")])
  
      ;; Value names not starting with but containing `quote'.
      (let ((:: x x' x'' Int)
            (= x 100)
            (= x' 200)
            (= x'' 300)))
      (print x)
      (print x')
      (print x'')
  
      ;; Some tabs
  
  
  
      ;; Function names starting with `#'.
      (let ((:: # #. ## (-> Int Int))
            (= # a (+ a 1))
            (= #. a (+ a 2))
            (= ## a (+ a 3))))
      (print ((#) 41))
      (print ((#.) 40))
      (print ((##) 39))
  
      ;; Function names starting with `%'.
      (let ((:: %. %% (-> Int Int))
            (= %. a (+ a 4))
            (= %% a (+ a 5))))
      (print ((%.) 38))
      (print ((%%) 37))))
  