projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1999-12-20 16:55:26 by sewardj]
[ghc-hetmet.git]
/
ghc
/
tests
/
programs
/
lex
/
Main.hs
1
module Main where
2
3
main = interact ( \ s -> shows (lex' s) "\n")
4
where lex' "" = []
5
lex' s = tok : lex' s' where -- [(tok,s')] = lex s
6
(tok,s') = case lex s of
7
[r] -> r
8
[] -> error ("Empty: " ++ s)
9
other -> error ("Multi: " ++ s)