Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. exception BadToken of string*(string list)
  2. fun
  3. advance ts = let val h = hd (!ts)
  4. val t = tl (!ts)
  5. in
  6. ts := t;
  7. h
  8. end
  9.  
  10. fun
  11. eat t ts = if (hd (!ts)) = t then (advance ts; t)
  12. else raise BadToken (t,!ts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement