Carl Worth
828686d4eb
glsl/glcpp: Drop extra, final newline from most output
...
The glcpp parser is line-based, so it needs to see a NEWLINE token at the end
of each line. This causes a trick for files that end without a final newline.
Previously, the lexer for glcpp punted in this case by unconditionally
returning a NEWLINE token at end-of-file, (causing most files to have an extra
blank line at the end). Here, we refine this by lexing end-of-file as a
NEWLINE token only if the immediately preceding token was not a NEWLINE token.
The patch is a minor change that only looks huge for two reasons:
1. Almost all glcpp test result ".expected" files are updated to drop
the extra newline.
2. All return statements from the lexer are adjusted to use a new
RETURN_TOKEN macro that tracks the last-token-was-a-newline state.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com >
2014-07-29 15:11:49 -07:00
..
2014-03-08 01:38:32 -08:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-07-20 17:01:11 -07:00
2014-07-29 15:11:49 -07:00
2010-07-20 17:01:11 -07:00
2014-07-29 15:11:49 -07:00
2010-07-20 17:01:12 -07:00
2014-07-29 15:11:49 -07:00
2010-07-22 16:38:12 -07:00
2014-07-29 15:11:49 -07:00
2012-06-26 15:20:03 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2010-08-04 23:37:19 -07:00
2014-07-29 15:11:49 -07:00
2010-08-04 23:37:19 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 12:43:44 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 12:43:44 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2012-11-29 13:03:01 -08:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2010-08-11 14:38:03 -07:00
2011-04-14 14:43:11 -07:00
2010-08-11 14:38:03 -07:00
2014-07-29 15:11:49 -07:00
2011-09-30 11:44:16 -07:00
2014-07-29 15:11:49 -07:00
2010-08-17 17:51:10 -07:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:13 -07:00
2014-07-29 15:11:49 -07:00
2010-08-17 23:41:53 -07:00
2014-07-29 15:11:49 -07:00
2010-08-23 10:48:10 -07:00
2014-07-29 15:11:49 -07:00
2012-06-26 15:23:55 -07:00
2014-07-29 15:11:49 -07:00
2010-12-27 23:20:35 -08:00
2014-07-29 15:11:49 -07:00
2011-01-04 13:18:19 -08:00
2014-07-29 15:11:49 -07:00
2011-04-14 14:42:52 -07:00
2014-07-29 15:11:49 -07:00
2011-01-04 16:39:19 -08:00
2014-07-29 15:11:49 -07:00
2011-09-30 11:43:40 -07:00
2014-07-29 15:11:49 -07:00
2011-09-30 11:44:04 -07:00
2014-07-29 15:11:49 -07:00
2012-06-26 15:20:03 -07:00
2014-07-29 15:11:49 -07:00
2010-06-24 15:36:00 -07:00
2014-07-29 15:11:49 -07:00
2012-02-02 12:05:21 -08:00
2014-07-29 15:11:49 -07:00
2012-02-02 12:05:21 -08:00
2014-07-29 15:11:49 -07:00
2012-11-09 14:33:08 -08:00
2012-11-09 14:33:08 -08:00
2014-07-09 12:05:13 -07:00
2014-07-09 12:05:13 -07:00
2012-11-09 14:33:08 -08:00
2014-07-29 15:11:49 -07:00
2012-11-09 14:33:08 -08:00
2014-07-29 15:11:49 -07:00
2012-11-09 14:33:08 -08:00
2014-07-29 15:11:49 -07:00
2012-11-09 14:33:08 -08:00
2014-07-29 15:11:49 -07:00
2012-11-28 10:26:53 -08:00
2014-07-29 15:11:49 -07:00
2012-11-28 10:26:53 -08:00
2014-07-29 15:11:49 -07:00
2012-11-28 10:27:02 -08:00
2014-07-29 15:11:49 -07:00
2012-11-28 10:27:02 -08:00
2014-07-29 15:11:49 -07:00
2012-11-28 10:27:02 -08:00
2014-07-29 15:11:49 -07:00
2012-11-29 13:03:01 -08:00
2014-07-29 15:11:49 -07:00
2012-11-29 13:03:02 -08:00
2014-07-29 15:11:49 -07:00
2013-01-11 13:55:41 -08:00
2014-07-29 15:11:49 -07:00
2013-01-11 13:55:41 -08:00
2014-07-29 15:11:49 -07:00
2013-06-03 13:33:32 -07:00
2014-07-29 15:11:49 -07:00
2014-01-02 14:15:51 -08:00
2014-07-29 15:11:49 -07:00
2014-01-02 14:22:58 -08:00
2014-07-29 15:11:49 -07:00
2014-01-02 14:22:58 -08:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:13 -07:00
2014-07-29 15:11:49 -07:00
2014-01-31 10:02:54 -08:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:13 -07:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:13 -07:00
2014-07-09 12:05:13 -07:00
2014-07-09 12:05:13 -07:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:13 -07:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:14 -07:00
2014-07-29 15:11:49 -07:00
2014-07-09 12:05:14 -07:00
2014-07-29 15:11:49 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:49 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:49 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2014-07-29 15:11:48 -07:00
2013-01-22 14:33:20 -08:00