mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
glcpp: Fix locations when encounting "#<NEWLINE>".
We were failing to reset our location tracking when encountering a
NEWLINE in the <HASH> state. Rip the code from the <*>{NEWLINE} rule,
which handles this properly.
Also, update 146-version-first-hash.c to have proper expectations.
When I introduced the test, I didn't verify that the line/column
numbers were correct, and it turns out they varied based on the type
of newline ending.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94447
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
84f857bef7
commit
e032e4ad5a
2 changed files with 4 additions and 1 deletions
|
|
@ -320,6 +320,9 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
||||||
|
|
||||||
<HASH>{NEWLINE} {
|
<HASH>{NEWLINE} {
|
||||||
BEGIN INITIAL;
|
BEGIN INITIAL;
|
||||||
|
yyextra->space_tokens = 0;
|
||||||
|
yylineno++;
|
||||||
|
yycolumn = 0;
|
||||||
RETURN_TOKEN_NEVER_SKIP (NEWLINE);
|
RETURN_TOKEN_NEVER_SKIP (NEWLINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
0:1(3): preprocessor error: #version must appear on the first line
|
0:2(1): preprocessor error: #version must appear on the first line
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue