From: Ulya Trofimovich Date: Sat, 28 Jul 2018 09:53:34 +0000 (+0100) Subject: Changed the name of a local variable in the test to avoid collision with skeleton... X-Git-Tag: 1.1~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26bd8967172800241a3796212af9d77872667b6f;p=re2c Changed the name of a local variable in the test to avoid collision with skeleton names. Before tags were added to re2c, skeleton programs only used a limited number of predefined names, such as 'yych', 'yystate', etc. With tags, however, this is no longer true as tags may have any names. So now we need to be more cautios when picking names for sekleton variables. This patch is only a workaround to make all tests pass; the real solution requires inventing a good naming scheme for skeleton programs and regenerating all skeleton test results. --- diff --git a/re2c/examples/09_etc_passwd.i--tags.c b/re2c/examples/09_etc_passwd.i--tags.c index 20f3adfe..ceeebd3d 100644 --- a/re2c/examples/09_etc_passwd.i--tags.c +++ b/re2c/examples/09_etc_passwd.i--tags.c @@ -7,7 +7,7 @@ static int lex(const char *YYCURSOR) { - const char *YYMARKER, *n, *p, *u, *g, *i, *h, *c; + const char *YYMARKER, *n, *p, *u, *g, *f, *h, *c; const char *yyt1;const char *yyt2;const char *yyt3;const char *yyt4;const char *yyt5;const char *yyt6;const char *yyt7; loop: @@ -193,15 +193,15 @@ yy28: p = yyt2; u = yyt3; g = yyt4; - i = yyt5; + f = yyt5; h = yyt6; c = yyt7; { printf("user: %.*s\n", (int)(p - n) - 1, n); printf("password: %.*s\n", (int)(u - p) - 1, p); printf("UID: %.*s\n", (int)(g - u) - 1, u); - printf("GID: %.*s\n", (int)(i - g) - 1, g); - printf("info: %.*s\n", (int)(h - i) - 1, i); + printf("GID: %.*s\n", (int)(f - g) - 1, g); + printf("info: %.*s\n", (int)(h - f) - 1, f); printf("home: %.*s\n", (int)(c - h) - 1, h); printf("command: %.*s\n", (int)(YYCURSOR - c - 1), c); printf("\n"); diff --git a/re2c/examples/09_etc_passwd.i--tags.re b/re2c/examples/09_etc_passwd.i--tags.re index 6564110e..7210f4e8 100644 --- a/re2c/examples/09_etc_passwd.i--tags.re +++ b/re2c/examples/09_etc_passwd.i--tags.re @@ -5,7 +5,7 @@ static int lex(const char *YYCURSOR) { - const char *YYMARKER, *n, *p, *u, *g, *i, *h, *c; + const char *YYMARKER, *n, *p, *u, *g, *f, *h, *c; /*!stags:re2c format = 'const char *@@;'; */ loop: /*!re2c @@ -31,14 +31,14 @@ loop: @p pass sep @u uid sep @g gid sep - @i info sep + @f info sep @h home sep @c cmd eol { printf("user: %.*s\n", (int)(p - n) - 1, n); printf("password: %.*s\n", (int)(u - p) - 1, p); printf("UID: %.*s\n", (int)(g - u) - 1, u); - printf("GID: %.*s\n", (int)(i - g) - 1, g); - printf("info: %.*s\n", (int)(h - i) - 1, i); + printf("GID: %.*s\n", (int)(f - g) - 1, g); + printf("info: %.*s\n", (int)(h - f) - 1, f); printf("home: %.*s\n", (int)(c - h) - 1, h); printf("command: %.*s\n", (int)(YYCURSOR - c - 1), c); printf("\n");