%{ /* rclex.l -- lexer for Windows rc files parser */
-/* Copyright 1997 Free Software Foundation, Inc.
+/* Copyright 1997, 1998 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
%%
"BEGIN" { return BEG; }
+"{" { return BEG; }
"END" { return END; }
+"}" { return END; }
"ACCELERATORS" { return ACCELERATORS; }
"VIRTKEY" { return VIRTKEY; }
"ASCII" { return ASCII; }
}
}
-[A-Za-z][^ \t\r\n]* {
+[A-Za-z][^ ,\t\r\n]* {
char *s;
+ /* I rejected comma in a string in order to
+ handle VIRTKEY, CONTROL in an accelerator
+ resource. This means that an unquoted
+ file name can not contain a comma. I
+ don't know what rc permits. */
+
s = get_string (strlen (yytext) + 1);
strcpy (s, yytext);
yylval.s = s;
char *send, *fn;
++s;
- while (isspace (*s))
+ while (isspace ((unsigned char) *s))
++s;
line = strtol (s, &send, 0);
- if (*send != '\0' && ! isspace (*send))
+ if (*send != '\0' && ! isspace ((unsigned char) *send))
return;
/* Subtract 1 because we are about to count the newline. */
rc_lineno = line - 1;
s = send;
- while (isspace (*s))
+ while (isspace ((unsigned char) *s))
++s;
if (*s != '"')
else
{
++t;
- assert (isspace (*t));
- while (isspace (*t))
+ assert (isspace ((unsigned char) *t));
+ while (isspace ((unsigned char) *t))
++t;
if (*t == '\0')
break;