You are probably using RegexParsers
. In documentation, you can find that:
The parsing methods call the method skipWhitespace (defaults to true) and, if true, skip any whitespace before each parser is called.
To change this:
object MyParsers extends RegexParsers {
override def skipWhitespace = false
//your parsers...
}