=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/bc/scan.l,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/bc/scan.l 2003/09/26 19:00:38 1.4 --- src/usr.bin/bc/scan.l 2003/09/28 07:57:57 1.5 *************** *** 1,5 **** %{ ! /* $OpenBSD: scan.l,v 1.4 2003/09/26 19:00:38 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek --- 1,5 ---- %{ ! /* $OpenBSD: scan.l,v 1.5 2003/09/28 07:57:57 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek *************** *** 18,24 **** */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: scan.l,v 1.4 2003/09/26 19:00:38 deraadt Exp $"; #endif /* not lint */ #include --- 18,24 ---- */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: scan.l,v 1.5 2003/09/28 07:57:57 otto Exp $"; #endif /* not lint */ #include *************** *** 50,55 **** --- 50,56 ---- \n lineno++; \* ; [^*\n]+ ; + <> fatal("end of file in comment"); } \" BEGIN(string); init_strbuf(); *************** *** 57,62 **** --- 58,64 ---- [^"\n]+ add_str(yytext); \n add_str("\n"); lineno++; \" BEGIN(INITIAL); yylval.str = strbuf; return STRING; + <> fatal("end of file in string"); } {DIGIT}+ { *************** *** 87,94 **** \\\n[ \t]* lineno++; [^0-9A-F\.] { if (strcmp(strbuf, ".") == 0) { ! warnx("unexpected ascii char 0x%x at line %d", ! yytext[0], lineno); BEGIN(INITIAL); REJECT; } --- 89,95 ---- \\\n[ \t]* lineno++; [^0-9A-F\.] { if (strcmp(strbuf, ".") == 0) { ! yyerror("syntax error"); BEGIN(INITIAL); REJECT; } *************** *** 159,165 **** \n lineno++; return NEWLINE; [ \t] ; ! . warnx("unexpected character %c at line %d", yytext[0], lineno); %% --- 160,166 ---- \n lineno++; return NEWLINE; [ \t] ; ! . yyerror("illegal character"); %%