Second attempt at fixing https://issues.apache.org/bugzilla/show_bug.cgi?id=56029 This fixes BZ56029 by storing any whitespace before a token with the token and then including it when the expression is re-created. It also fixes an issue with the function parsing that meant that ternary expressions could be corrupted if two tokens were parsed before the mark was reset.