tried to fix lexer.ll for newer flex version
[supertux.git] / tools / miniswig / lexer.ll
index 0e6229c..71d54ed 100644 (file)
@@ -5,7 +5,7 @@
 #include "parser.hpp"
 #include "globals.h"
 
-#define YY_DECL int yylex YY_PROTO(( YYSTYPE* yylval ))
+#define YY_DECL int yylex(YYSTYPE* yylval)
 
 #define YY_INPUT(buf, result, max_size)                     \
 {                                                           \
@@ -49,14 +49,9 @@ namespace                               { return T_NAMESPACE; }
         if(ns == 0)
             ns = current_namespace;          
         // is it a type?
-        for(std::vector<AtomicType*>::iterator i = ns->types.begin();
-                i != ns->types.end(); ++i) {
-            AtomicType* type = *i;
-            if(type->name == yytext) {
-                yylval->atomic_type = type;
-                return T_ATOMIC_TYPE;
-            }
-        }
+        yylval->atomic_type = ns->_findType(yytext, search_down);
+        if(yylval->atomic_type)
+            return T_ATOMIC_TYPE;
         // or a namespace? (hack for now...)
         yylval->_namespace = ns->_findNamespace(yytext, search_down);
         if(yylval->_namespace) {