Use a regular expression instead of a literal.
lazy val caseSensitiveKeyword: Parser[String] = "casesensitive"
lazy val caseInsensitiveKeyWord: Parser[String] = """(?i)\Qcaseinsensitive\E""".r
(See the docs for java.util.Pattern for info on the regex syntax used.)
If you're doing this frequently you could pimp String to simplify the syntax:
class MyRichString(str: String) {
def ignoreCase: Parser[String] = ("""(?i)\Q""" + str + """\E""").r
}
implicit def pimpString(str: String): MyRichString = new MyRichString(str)
lazy val caseInsensitiveKeyword = "caseinsensitive".ignoreCase