JavaTokensParser
by default allows white spaces between any parsers. You could change this behavior this way:
override def skipWhitespace = false
Now you have to specify all white spaces manually:
def ws: Parser[Seq[Char]] = rep(' ')
def variableExpr = ws ~> "?" ~ identifier ^^ { case "?" ~ id => Var(id) }