# HG changeset patch # User wenzelm # Date 1728248167 -7200 # Node ID 6ce0c8d59f5acfaaf9f11117dc3b07bd95a8de95 # Parent c531629c391a3dc80dffca655b8fe769bad8bfe2 more inner-syntax markup, without pretty blocks; diff -r c531629c391a -r 6ce0c8d59f5a src/HOL/Library/Numeral_Type.thy --- a/src/HOL/Library/Numeral_Type.thy Sun Oct 06 21:55:31 2024 +0200 +++ b/src/HOL/Library/Numeral_Type.thy Sun Oct 06 22:56:07 2024 +0200 @@ -523,13 +523,9 @@ subsection \Syntax\ syntax - "_NumeralType" :: "num_token => type" (\_\) - "_NumeralType0" :: type (\0\) - "_NumeralType1" :: type (\1\) - -syntax_types - "_NumeralType0" == num0 and - "_NumeralType1" == num1 + "_NumeralType" :: "num_token => type" (\(\open_block notation=\type_literal number\\_)\) + "_NumeralType0" :: type (\(\open_block notation=\type_literal number\\0)\) + "_NumeralType1" :: type (\(\open_block notation=\type_literal number\\1)\) translations (type) "1" == (type) "num1" diff -r c531629c391a -r 6ce0c8d59f5a src/HOL/Num.thy --- a/src/HOL/Num.thy Sun Oct 06 21:55:31 2024 +0200 +++ b/src/HOL/Num.thy Sun Oct 06 22:56:07 2024 +0200 @@ -302,7 +302,7 @@ text \Numeral syntax.\ syntax - "_Numeral" :: "num_const \ 'a" (\_\) + "_Numeral" :: "num_const \ 'a" (\(\open_block notation=\literal number\\_)\) ML_file \Tools/numeral.ML\ diff -r c531629c391a -r 6ce0c8d59f5a src/HOL/Rat.thy --- a/src/HOL/Rat.thy Sun Oct 06 21:55:31 2024 +0200 +++ b/src/HOL/Rat.thy Sun Oct 06 22:56:07 2024 +0200 @@ -1155,7 +1155,7 @@ subsection \Float syntax\ -syntax "_Float" :: "float_const \ 'a" (\_\) +syntax "_Float" :: "float_const \ 'a" (\(\open_block notation=\literal number\\_)\) parse_translation \ let diff -r c531629c391a -r 6ce0c8d59f5a src/HOL/String.thy --- a/src/HOL/String.thy Sun Oct 06 21:55:31 2024 +0200 +++ b/src/HOL/String.thy Sun Oct 06 22:56:07 2024 +0200 @@ -216,15 +216,15 @@ by (cases c) simp syntax - "_Char" :: "str_position \ char" (\CHR _\) - "_Char_ord" :: "num_const \ char" (\CHR _\) + "_Char" :: "str_position \ char" (\(\open_block notation=\literal char\\CHR _)\) + "_Char_ord" :: "num_const \ char" (\(\open_block notation=\literal char code\\CHR _)\) syntax_consts "_Char" "_Char_ord" \ Char type_synonym string = "char list" syntax - "_String" :: "str_position \ string" (\(\notation=\literal string\\_)\) + "_String" :: "str_position \ string" (\(\open_block notation=\literal string\\_)\) ML_file \Tools/string_syntax.ML\ @@ -522,8 +522,10 @@ code_datatype "0 :: String.literal" String.Literal syntax - "_Literal" :: "str_position \ String.literal" (\STR _\) - "_Ascii" :: "num_const \ String.literal" (\STR _\) + "_Literal" :: "str_position \ String.literal" + (\(\open_block notation=\literal string\\STR _)\) + "_Ascii" :: "num_const \ String.literal" + (\(\open_block notation=\literal char code\\STR _)\) syntax_consts "_Literal" "_Ascii" \ String.Literal diff -r c531629c391a -r 6ce0c8d59f5a src/Pure/PIDE/markup_kind.ML --- a/src/Pure/PIDE/markup_kind.ML Sun Oct 06 21:55:31 2024 +0200 +++ b/src/Pure/PIDE/markup_kind.ML Sun Oct 06 22:56:07 2024 +0200 @@ -22,6 +22,7 @@ val markup_postfix: Markup.T val markup_infix: Markup.T val markup_binder: Markup.T + val markup_type_literal: Markup.T val markup_literal: Markup.T val markup_type_application: Markup.T val markup_application: Markup.T @@ -101,6 +102,7 @@ val markup_postfix = setup_notation (Binding.make ("postfix", \<^here>)); val markup_infix = setup_notation (Binding.make ("infix", \<^here>)); val markup_binder = setup_notation (Binding.make ("binder", \<^here>)); +val markup_type_literal = setup_notation (Binding.make ("type_literal", \<^here>)); val markup_literal = setup_notation (Binding.make ("literal", \<^here>)); val markup_type_application = setup_notation (Binding.make ("type_application", \<^here>)); diff -r c531629c391a -r 6ce0c8d59f5a src/Pure/pure_thy.ML --- a/src/Pure/pure_thy.ML Sun Oct 06 21:55:31 2024 +0200 +++ b/src/Pure/pure_thy.ML Sun Oct 06 22:56:07 2024 +0200 @@ -113,11 +113,14 @@ ("_class_name", typ "id \ class_name", Mixfix.mixfix "_"), ("_class_name", typ "longid \ class_name", Mixfix.mixfix "_"), ("_dummy_sort", typ "sort", Mixfix.mixfix "'_"), - ("_topsort", typ "sort", Mixfix.mixfix "{}"), - ("_sort", typ "classes \ sort", Mixfix.mixfix "{_}"), + ("_topsort", typ "sort", + Mixfix.mixfix "(\open_block notation=\mixfix sort\\{})"), + ("_sort", typ "classes \ sort", + Mixfix.mixfix "(\open_block notation=\mixfix sort\\{_})"), ("", typ "class_name \ classes", Mixfix.mixfix "_"), ("_classes", typ "class_name \ classes \ classes", Mixfix.mixfix "_,_"), - ("_tapp", typ "type \ type_name \ type", mixfix ("_ _", [1000, 0], 1000)), + ("_tapp", typ "type \ type_name \ type", + mixfix ("(\open_block notation=\type_application\\_ _)", [1000, 0], 1000)), ("_tappl", typ "type \ types \ type_name \ type", Mixfix.mixfix "(\notation=type_application\(1'(_,/ _')) _)"), ("", typ "type \ types", Mixfix.mixfix "_"), @@ -149,7 +152,8 @@ ("", typ "longid_position \ aprop", Mixfix.mixfix "_"), ("", typ "var_position \ aprop", Mixfix.mixfix "_"), ("_DDDOT", typ "aprop", Mixfix.mixfix "\"), - ("_aprop", typ "aprop \ prop", Mixfix.mixfix "PROP _"), + ("_aprop", typ "aprop \ prop", + Mixfix.mixfix "(\open_block notation=\mixfix atomic prop\\PROP _)"), ("_asm", typ "prop \ asms", Mixfix.mixfix "_"), ("_asms", typ "prop \ asms \ asms", Mixfix.mixfix "_;/ _"), ("_bigimpl", typ "asms \ prop \ prop", diff -r c531629c391a -r 6ce0c8d59f5a src/ZF/Bin.thy --- a/src/ZF/Bin.thy Sun Oct 06 21:55:31 2024 +0200 +++ b/src/ZF/Bin.thy Sun Oct 06 22:56:07 2024 +0200 @@ -114,8 +114,8 @@ "#-2" \ "CONST integ_of(CONST Min BIT 0)" syntax - "_Int" :: "num_token \ i" (\#_\ 1000) - "_Neg_Int" :: "num_token \ i" (\#-_\ 1000) + "_Int" :: "num_token \ i" (\(\open_block notation=\literal number\\#_)\ 1000) + "_Neg_Int" :: "num_token \ i" (\(\open_block notation=\literal number\\#-_)\ 1000) syntax_consts "_Int0" "_Int1" "_Int2" "_Int" "_Neg_Int1" "_Neg_Int2" "_Neg_Int" \ integ_of