more accurate markup (amending 43c4817375bf): only consider primitive syntax consts, avoid extra Markup.intensify e.g. due to "\<^const>Pure.all_binder";
authorwenzelm
Fri, 23 Aug 2024 21:32:09 +0200
changeset 80751 c7f7e58509af
parent 80750 1319c729c65d
child 80752 2c9b5288eb84
more accurate markup (amending 43c4817375bf): only consider primitive syntax consts, avoid extra Markup.intensify e.g. due to "\<^const>Pure.all_binder";
src/Pure/Syntax/syntax.ML
--- a/src/Pure/Syntax/syntax.ML	Fri Aug 23 20:45:54 2024 +0200
+++ b/src/Pure/Syntax/syntax.ML	Fri Aug 23 21:32:09 2024 +0200
@@ -475,7 +475,10 @@
     "Cycle in syntax consts: " ^ (space_implode " \<leadsto> " (map quote cs))) css));
 
 fun get_consts (Syntax ({consts, ...}, _)) c =
-  if Graph.defined consts c then Graph.all_preds consts [c] else [c];
+  if Graph.defined consts c then
+    Graph.all_preds consts [c]
+    |> filter (Graph.Keys.is_empty o Graph.imm_preds consts)
+  else [c];
 
 fun update_consts (c, bs) consts =
   if c = "" orelse (null bs andalso (Lexicon.is_marked c orelse Graph.defined consts c))