= { return EQUALS; }
\[strings\] { return STRINGSSECTION; }
+^#endif[\r\t ]+\n { return ENDIF; }
+^#if([^\n]+)\n { lineno++; yylval.text = strdup((const char *)yytext); return IF; }
+
[0-9]+ {
char *e, *y = yytext;
yylval.integer = strtol((const char *)yytext, &e, 0);
%token SPIN
%token EQUALS
%token STRINGSSECTION
+%token <text> IF
+%token ENDIF
%start admfile
admfile: classes strings;
-classes: /* empty */ | class classes;
+preprocessor: IF | ENDIF;
+
+classes: /* empty */ | class classes | preprocessor classes;
class: CLASS classvalue categories;
classvalue: CLASS_USER|CLASS_MACHINE;
class AdmTests(unittest.TestCase):
def test_simple(self):
+ self.assertEquals(True, True)