mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
re-implement the comment lexer using states to re-learn how things work prior to implementing preqcc support
This commit is contained in:
parent
542c1bb0d9
commit
03e1d6c3bf
1 changed files with 9 additions and 16 deletions
|
@ -99,26 +99,19 @@ NUM ({DIGIT}+("."{DIGIT}*)?)
|
|||
s [ \t]
|
||||
m ([\-+]?)
|
||||
|
||||
%x grab_frame grab_other
|
||||
%x grab_frame grab_other comment
|
||||
|
||||
%%
|
||||
|
||||
"/*" {
|
||||
int c;
|
||||
do {
|
||||
while ((c = input ()) != '*' && c != EOF
|
||||
&& c != '\n')
|
||||
;
|
||||
while (c == '*')
|
||||
c = input ();
|
||||
if (c == EOF)
|
||||
error (0, "EOF in comment");
|
||||
if (c == '\n')
|
||||
pr.source_line++;
|
||||
} while (c != '/' && c != EOF);
|
||||
"/*" { BEGIN (comment); }
|
||||
<comment>"*/" { BEGIN (INITIAL); }
|
||||
<comment>\r*\n { pr.source_line++; }
|
||||
<comment>. /* nothing to do */
|
||||
<comment><<EOF>> {
|
||||
error (0, "EOF in comment");
|
||||
return 0;
|
||||
}
|
||||
|
||||
"//".* /* nothing to do */
|
||||
"//".* /* nothing to do */
|
||||
|
||||
{DIGIT}+ {
|
||||
yylval.integer_val = atoi (yytext);
|
||||
|
|
Loading…
Reference in a new issue