[Mesa-dev] [PATCH 2/6] glsl/glcpp: Allow vertical tab and form feed characters in GLSL

Carl Worth cworth at cworth.org
Tue Aug 5 16:33:03 PDT 2014


Of course, these aren't really useful for anything, but the GLSL language
specification does allow them:

	The source character set used for the OpenGL shading languages,
	outside of comments, is a subset of UTF-8. It includes the following
	characters:
	...

	White space: the space character, horizontal tab, vertical tab, form
	feed, carriage-return, and line- feed.

	[GLSL Language Specification 4.30.6, section 3.1]

So treat vertical tab ('\v' or ^K) and form-feed ('\f' or ^L) as horizontal
space characters.
---
 src/glsl/glcpp/glcpp-lex.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index c126850..0dbdab0 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -170,7 +170,7 @@ glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token)
 
 SPACE		[[:space:]]
 NONSPACE	[^[:space:]]
-HSPACE		[ \t]
+HSPACE		[ \t\v\f]
 HASH		#
 IDENTIFIER	[_a-zA-Z][_a-zA-Z0-9]*
 PP_NUMBER	[.]?[0-9]([._a-zA-Z0-9]|[eEpP][-+])*
-- 
2.0.0



More information about the mesa-dev mailing list