src/Pure/Isar/parse.ML
changeset 42519 8ac7e96f913b
parent 42326 e2d22eb4aeb9
child 42657 6b404fe40877
equal deleted inserted replaced
42518:57367832b81a 42519:8ac7e96f913b
   112 
   112 
   113 (* group atomic parsers (no cuts!) *)
   113 (* group atomic parsers (no cuts!) *)
   114 
   114 
   115 fun fail_with s = Scan.fail_with
   115 fun fail_with s = Scan.fail_with
   116   (fn [] => s ^ " expected (past end-of-file!)"
   116   (fn [] => s ^ " expected (past end-of-file!)"
   117     | (tok :: _) =>
   117     | tok :: _ =>
   118         (case Token.text_of tok of
   118         (case Token.text_of tok of
   119           (txt, "") =>
   119           (txt, "") =>
   120             s ^ " expected,\nbut " ^ txt ^ Token.pos_of tok ^ " was found"
   120             s ^ " expected,\nbut " ^ txt ^ Token.pos_of tok ^ " was found"
   121         | (txt1, txt2) =>
   121         | (txt1, txt2) =>
   122             s ^ " expected,\nbut " ^ txt1 ^ Token.pos_of tok ^ " was found:\n" ^ txt2));
   122             s ^ " expected,\nbut " ^ txt1 ^ Token.pos_of tok ^ " was found:\n" ^ txt2));