Isar.define_command: identify transaction;
authorwenzelm
Tue, 15 Sep 2009 15:17:53 +0200
changeset 32573 62b5b538408d
parent 32572 076da2bd61f4
child 32575 bf6c78d9f94c
Isar.define_command: identify transaction;
src/Pure/General/position.ML
src/Pure/Isar/isar_document.ML
--- a/src/Pure/General/position.ML	Tue Sep 15 13:09:13 2009 +0200
+++ b/src/Pure/General/position.ML	Tue Sep 15 15:17:53 2009 +0200
@@ -21,6 +21,7 @@
   val line: int -> T
   val line_file: int -> string -> T
   val id: string -> T
+  val id_only: string -> T
   val get_id: T -> string option
   val put_id: string -> T -> T
   val of_properties: Properties.T -> T
@@ -97,8 +98,8 @@
 fun line_file i name = Pos ((i, 0, 0), file_name name);
 fun line i = line_file i "";
 
-
 fun id id = Pos ((0, 0, 1), [(Markup.idN, id)]);
+fun id_only id = Pos ((0, 0, 0), [(Markup.idN, id)]);
 
 fun get_id (Pos (_, props)) = Properties.get props Markup.idN;
 fun put_id id (Pos (count, props)) = Pos (count, Properties.put (Markup.idN, id) props);
--- a/src/Pure/Isar/isar_document.ML	Tue Sep 15 13:09:13 2009 +0200
+++ b/src/Pure/Isar/isar_document.ML	Tue Sep 15 15:17:53 2009 +0200
@@ -278,6 +278,7 @@
 val _ =
   OuterSyntax.internal_command "Isar.define_command"
     (P.string -- P.string >> (fn (id, text) =>
+      Toplevel.position (Position.id_only id) o
       Toplevel.imperative (fn () =>
         define_command id (OuterSyntax.prepare_command (Position.id id) text))));