# HG changeset patch # User wenzelm # Date 1541866037 -3600 # Node ID e6997512ef6cc0611f4094eb142233f43b7b974b # Parent 30f6e8d2cd96c13e90d4ed58d8b7f2b484d2260b more Haskell antiquotations; diff -r 30f6e8d2cd96 -r e6997512ef6c src/Pure/Tools/ghc.ML --- a/src/Pure/Tools/ghc.ML Sat Nov 10 16:32:00 2018 +0100 +++ b/src/Pure/Tools/ghc.ML Sat Nov 10 17:07:17 2018 +0100 @@ -114,6 +114,10 @@ SOME s => s | NONE => raise Fail "No result"); +fun path_antiq check = + Args.context -- Scan.lift (Parse.position Parse.path) >> (fn (ctxt, (name, pos)) => + (check ctxt Path.current (name, pos) |> Path.implode |> print_string)); + val _ = Theory.setup (antiquotation \<^binding>\cartouche\ (Scan.lift Args.cartouche_input) @@ -122,6 +126,9 @@ (ML_Context.expression (Input.pos_of argument) (ML_Lex.read "Theory.local_setup (GHC.set_result (" @ ML_Lex.read_source argument @ ML_Lex.read "))")) - |> the_result |> print_string)); + |> the_result |> print_string) #> + antiquotation \<^binding>\path\ (path_antiq Resources.check_path) #argument #> + antiquotation \<^binding>\file\ (path_antiq Resources.check_file) #argument #> + antiquotation \<^binding>\dir\ (path_antiq Resources.check_dir) #argument); end;