Skip to content

Instantly share code, notes, and snippets.

@skeet70
Created January 25, 2013 06:19
Show Gist options
  • Save skeet70/4632174 to your computer and use it in GitHub Desktop.
Save skeet70/4632174 to your computer and use it in GitHub Desktop.
eFSA
eFSA :: (String, String, Int, Int) -> (String, String, Int, Int)
eFSA (source, lexeme, col, line)
| nextChar == 'e' || nextChar == 'E' && isDigit secondChar
= eFSA (tail source, nextChar : lexeme, col + 1, line)
| isDigit nextChar
= eFSA (tail source, nextChar : lexeme, col + 1, line)
| otherwise (source, lexeme, col, line)
where
nextChar = head source
secondChar = snd source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment