The parser will match the specified grammar exactly, like it should. You could of course specify a grammar that is broader than the actual language you are parsing.
Well, I am vaguely aware of the existence of "incremental parsers" and "tolerant parsers", and a code editor necessarily works on code that's only partially correct...