added check for newlines not enclosed by '\' inside strings
authorclasohm
Mon, 14 Nov 1994 14:47:20 +0100
changeset 712 1f5800d2c366
parent 711 bb868a30e66f
child 713 b470cc6326aa
added check for newlines not enclosed by '\' inside strings
src/Pure/Thy/thy_scan.ML
--- a/src/Pure/Thy/thy_scan.ML	Mon Nov 14 14:29:20 1994 +0100
+++ b/src/Pure/Thy/thy_scan.ML	Mon Nov 14 14:47:20 1994 +0100
@@ -73,7 +73,10 @@
       (case optional scan_esc cs of
         (None, _) => lex_err n "bad escape sequence in string"
       | (Some s, cs') => cons_fst ("\\" ^ s) (string cs' (inc_line n s)))
-  | string (c :: cs) n = cons_fst c (string cs n)
+  | string (c :: cs) n = 
+      if c = "\n" then 
+        lex_err n "no matching quote found on this line"
+      else cons_fst c (string cs n)
   | string [] n = lex_err n "missing quote at end of string";