changeset 2042:31f4f775b8c6

[project @ 1996-03-28 09:06:28 by jwe]
author jwe
date Thu, 28 Mar 1996 09:06:39 +0000
parents 70dedaeb25b9
children a7394e14f4a6
files src/lex.l src/utils.h
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lex.l	Thu Mar 28 01:50:17 1996 +0000
+++ b/src/lex.l	Thu Mar 28 09:06:39 1996 +0000
@@ -139,8 +139,8 @@
 
 D	[0-9]
 S	[ \t]
-NL	[\n]
-SNL	[ \t\n]
+NL	((\n)|(\r\n))
+SNL	({S}|{NL})
 EL	(\.\.\.)
 BS	(\\)
 CONT	({EL}|{BS})
@@ -576,7 +576,10 @@
 // eventually result in a parse error.
 %}
 
-.		{ TOK_RETURN (yytext[0]); }
+. {
+    error ("invalid character `%s' on input", undo_string_escape (yytext[0]));
+    TOK_RETURN (yytext[0]);
+}
 
 %%
 
--- a/src/utils.h	Thu Mar 28 01:50:17 1996 +0000
+++ b/src/utils.h	Thu Mar 28 09:06:39 1996 +0000
@@ -56,6 +56,8 @@
 
 extern int empty_arg (const char *name, int nr, int nc);
 
+extern const char *undo_string_escape (char c);
+
 extern string undo_string_escapes (const string& s);
 
 extern void oct_putenv (const char *, const char *);