[antlr-interest] Newlines (yet again)

Paul J. Lucas pauljlucas at mac.com
Mon Jan 17 21:08:22 PST 2005

	A while ago, I mentioned that I do:

		('\r')? '\n' { newline(); }

	to match newlines.  It seems to be the case that explicitly
	testing for the '\r' is unnecessary: if a '\n' is required, who
	cares what the character immediately before it is?  So this can
	simply be:

		'\n' { newline(); }

	and it will work on both *nix and Windows, right?

	- Paul

More information about the antlr-interest mailing list