I am currently working with Scanners and Parsers and need a Parser that accepts characters that are ASCII letters - so I can't use
def letter = elem("ascii letter", _.toString.matches("""[a-zA-Z]"""))
def letter = elem("ascii letter", c => ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))
You say you can't use
Char.isLetter because you only want ASCII letters. Why not just restrict it to the 7-bit ASCII character range?
def isAsciiLetter(c: Char) = c.isLetter && c <= 'z'
If the reader wants to check for ASCII including non-letters then:
def isAscii(c: Char) = c <= '~'