extern int yyparse();
void yyerror(char *err);
-extern int yylineno;
+extern int lineno;
extern FILE *yyin;
static char *path;
sections:
| sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n'
- { ++yylineno; } lines
+ { ++lineno; } lines
;
lines:
| lines tokens { t.type='\n'; t.data.character='\n'; parse_token(&t); } '\n'
- { ++yylineno; }
+ { ++lineno; }
| lines IDENTIFIER '=' listtoken { parse_assign($2, &t); } '\n'
- { ++yylineno; }
+ { ++lineno; }
;
tokens:
%%
+int lineno;
+
void yyerror(char *err) {
- g_message("%s:%d: %s", path, yylineno, err);
+ g_message("%s:%d: %s", path, lineno, err);
}
void parse_rc()
}
}
- yylineno = 1;
+ lineno = 1;
yyparse();