A simple lexer written in Swift