Use isWhitespace in getIfElseOccurrences.