Artur Świgoń artur.swigon@gmail.com writes:
@@ -138,6 +142,14 @@ static int wbufalloc = 0;
static int current_codepage = -1; /* use language default */
+/* Used for differentiating between single- and double-quoted nameID's */ +static int id_dblquote = 0;
+/* Used for catching first (quoted) nameID before wanted_id is set.
- This variable is reset to 0 once the first ID (quoted or not), string or
- data has been encountered */
+static int id_initial = 1;
That's a bit hackish. Couldn't you simply set the initial state appropriately instead of introducing a separate variable?
@@ -402,8 +414,30 @@ static unsigned long xstrtoul(const char *nptr, char **endptr, int base) 0[oO][0-7]+[lL]? { parser_lval.num = xstrtoul(yytext+2, 0, 8); return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
+<tkid_dbl>[A-Za-z_0-9./\']+" | +<tkid_sgl>[A-Za-z_0-9./\"]+' {
There are more characters that should be allowed. Nested quotes are also supposed to work.
I am terribly sorry for my late reply. Please see my comments below. A draft version of another patch is in the attachment.
Alexandre Julliard julliard@winehq.org writes:
Artur Świgoń artur.swigon@gmail.com writes:
@@ -138,6 +142,14 @@ static int wbufalloc = 0;
static int current_codepage = -1; /* use language default */
+/* Used for differentiating between single- and double-quoted nameID's */ +static int id_dblquote = 0;
+/* Used for catching first (quoted) nameID before wanted_id is set.
- This variable is reset to 0 once the first ID (quoted or not), string or
- data has been encountered */
+static int id_initial = 1;
That's a bit hackish. Couldn't you simply set the initial state appropriately instead of introducing a separate variable?
I could not make wanted_id have the right value before the first ID. Neither changing its value at file scope nor in YY_USER_INIT works. The new proposed solution sets id_dblquote initially to -1 to get rid of a redundant variable.
@@ -402,8 +414,30 @@ static unsigned long xstrtoul(const char *nptr, char **endptr, int base) 0[oO][0-7]+[lL]? { parser_lval.num = xstrtoul(yytext+2, 0, 8); return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
+<tkid_dbl>[A-Za-z_0-9./\']+" | +<tkid_sgl>[A-Za-z_0-9./\"]+' {
There are more characters that should be allowed. Nested quotes are also supposed to work.
Nested quotes now work (excluding some exotic combinations that VS2017 rc.exe accepts, allowing which, as it seems to me, would require a major rewrite instead of a patch). What characters besides both types of quotes should be additionally allowed?
Artur Świgoń
Artur Świgoń aswigon@aswigon.pl writes:
Nested quotes now work (excluding some exotic combinations that VS2017 rc.exe accepts, allowing which, as it seems to me, would require a major rewrite instead of a patch). What characters besides both types of quotes should be additionally allowed?
Pretty much anything is allowed. The thing is that RC is apparently not doing string processing, more like grabbing everything until the first space or something like that. For instance, you can do this:
"!"#$%&'()*+,-./0123:;<=>?@ABC[]^_`abc{|}~ DIALOG 10,10,100,100 STYLE 0x80000000 BEGIN END