glcpp: Do not remove spaces to preserve locations.
After preprocessing by glcpp all adjacent spaces were replaced by single one and glsl parser received column-shifted shader source. It negatively affected ast location set up and produced wrong error messages for heavily-spaced shaders. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
committed by
Kenneth Graunke
parent
da2275cd9b
commit
6e39a8f6ec
@@ -338,7 +338,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
||||
return OTHER;
|
||||
}
|
||||
|
||||
{HSPACE}+ {
|
||||
{HSPACE} {
|
||||
if (yyextra->space_tokens) {
|
||||
return SPACE;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
this is four tokens
|
||||
this is four tokens with spaces
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
this is four tokens
|
||||
this is four tokens with spaces
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
switch (1) {
|
||||
case 1 + 2:
|
||||
break;
|
||||
case 1 + 2:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user