# HG changeset patch # User wenzelm # Date 1513101220 -3600 # Node ID 4ade0d38742989af05c7f6a5a5a1d1f13fc3487b # Parent 26f548370e8d20d67e9d9c3462c5a71f61763358 scan only one line, for more detailed positions; diff -r 26f548370e8d -r 4ade0d387429 src/Pure/General/antiquote.ML --- a/src/Pure/General/antiquote.ML Tue Dec 12 17:53:59 2017 +0100 +++ b/src/Pure/General/antiquote.ML Tue Dec 12 18:53:40 2017 +0100 @@ -76,11 +76,15 @@ val err_prefix = "Antiquotation lexical error: "; +val scan_nl = Scan.one (fn (s, _) => s = "\n") >> single; + val scan_txt = + scan_nl || Scan.repeats1 (Scan.many1 (fn (s, _) => - not (Symbol.is_control s) andalso s <> Symbol.open_ andalso s <> "@" andalso Symbol.not_eof s) || - $$$ "@" --| Scan.ahead (~$$ "{")); + not (Symbol.is_control s) andalso s <> Symbol.open_ andalso s <> "@" andalso + s <> "\n" andalso Symbol.not_eof s) || + $$$ "@" --| Scan.ahead (~$$ "{")) @@@ Scan.optional scan_nl []; val scan_antiq_body = Scan.trace (Symbol_Pos.scan_string_qq err_prefix || Symbol_Pos.scan_string_bq err_prefix) >> #2 ||