# HG changeset patch # User wenzelm # Date 1511779241 -3600 # Node ID 91ffe1f8bf5c1a947f27cf0a14358171ab53fb23 # Parent 4a2563645635d65fede6480d7b19e8b2c4c92cea proper treatment of multi-line cartouche as rudiment of antiquotation, e.g. relevant for syntax-highlighting in Isabelle/jEdit; diff -r 4a2563645635 -r 91ffe1f8bf5c src/Pure/ML/ml_lex.scala --- a/src/Pure/ML/ml_lex.scala Mon Nov 27 10:36:43 2017 +0100 +++ b/src/Pure/ML/ml_lex.scala Mon Nov 27 11:40:41 2017 +0100 @@ -221,6 +221,9 @@ /* antiquotations (line-oriented) */ + def ml_cartouche_line(ctxt: Scan.Line_Context): Parser[(Token, Scan.Line_Context)] = + cartouche_line(ctxt) ^^ { case (x, c) => (Token(Kind.ANTIQ_CARTOUCHE, x), c) } + def ml_antiq_start(ctxt: Scan.Line_Context): Parser[(Token, Scan.Line_Context)] = ctxt match { case Scan.Finished => "@{" ^^ (x => (Token(Kind.ANTIQ_START, x), Antiq(Scan.Finished))) @@ -257,7 +260,8 @@ else ml_string_line(ctxt) | (ml_comment_line(ctxt) | - (ml_antiq_start(ctxt) | (ml_antiq_stop(ctxt) | (ml_antiq_body(ctxt) | other)))) + (ml_cartouche_line(ctxt) | + (ml_antiq_start(ctxt) | (ml_antiq_stop(ctxt) | (ml_antiq_body(ctxt) | other))))) } }