Would that include removing characters from the script that triggers on the page load?

If so, it'd be more interesting if the lexer didn't barf on syntax error, but perhaps just skipped characters until it finds a valid token. And probably some similar "best effort" algorithm for the parser.