From a1988411e9345dda06f2c273691bf87693e0d88a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 10 Jan 2012 03:35:11 +1000 Subject: Get rid of the comment function. --- LuaSL/src/LuaSL_lexer.l | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'LuaSL/src/LuaSL_lexer.l') diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index aaba74a..d81eb29 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l @@ -4,7 +4,6 @@ #include "LuaSL_LSL_tree.h" #include -void comment(yyscan_t yyscanner); int common(YYSTYPE *lval, char *text, boolean checkIgnorable, int type); %} @@ -93,7 +92,7 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])* "state" %{ return common(yylval, yytext, TRUE, LSL_STATE_CHANGE); %} "while" %{ return common(yylval, yytext, TRUE, LSL_WHILE); %} -{IDENTIFIER} %{ /* yylval->value.nameValue = strdup(yytext); */ common(yylval, yytext, TRUE, LSL_IDENTIFIER); %} +{IDENTIFIER} %{ /* yylval->value.identifierValue = strdup(yytext); */ common(yylval, yytext, TRUE, LSL_IDENTIFIER); %} /* Other symbols. */ "@" %{ return common(yylval, yytext, TRUE, LSL_LABEL); %} @@ -108,19 +107,6 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])* %% -void comment(yyscan_t yyscanner) -{ - char c, prev = 0; - - while ((c = input(yyscanner)) != 0) /* (EOF maps to 0) */ - { - if (c == '/' && prev == '*') - return; - prev = c; - } - yyerror("unterminated comment"); -} - static char *ignorableText = NULL; static int column = 0; static int line = 0; @@ -182,6 +168,7 @@ int yywrap(yyscan_t yyscanner) #ifndef LL_WINDOWS // Get gcc to stop complaining about lack of use of yyunput and input. (void) yyunput; + (void) input; #endif #endif // TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them and return 0. Return 1 when there are no more files. -- cgit v1.1