diff --git a/src/Lean/Elab/Tactic/Config.lean b/src/Lean/Elab/Tactic/Config.lean index 160b8cb092..9961bf24b2 100644 --- a/src/Lean/Elab/Tactic/Config.lean +++ b/src/Lean/Elab/Tactic/Config.lean @@ -114,6 +114,13 @@ private def elabConfig (recover : Bool) (structName : Name) (items : Array Confi let e ← Term.withSynthesize <| Term.elabTermEnsuringType stx (mkConst structName) instantiateMVars e +section +-- We automatically disable the following option for `macro`s but the subsequent `def` both contains +-- a quotation and is called only by `macro`s, so we disable the option for it manually. Note that +-- we can't use `in` as it is parsed as a single command and so the option would not influence the +-- parser. +set_option internal.parseQuotWithCurrentStage false + private def mkConfigElaborator (doc? : Option (TSyntax ``Parser.Command.docComment)) (elabName type monadName : Ident) (adapt recover : Term) : MacroM (TSyntax `command) := do @@ -148,6 +155,8 @@ private def mkConfigElaborator throwError msg go) +end + /-! `declare_config_elab elabName TypeName` declares a function `elabName : Syntax → TacticM TypeName` that elaborates a tactic configuration. diff --git a/stage0/src/stdlib_flags.h b/stage0/src/stdlib_flags.h index 0699845ba4..658ab0874e 100644 --- a/stage0/src/stdlib_flags.h +++ b/stage0/src/stdlib_flags.h @@ -8,7 +8,7 @@ options get_default_options() { // switch to `true` for ABI-breaking changes affecting meta code opts = opts.update({"interpreter", "prefer_native"}, false); // switch to `true` for changing built-in parsers used in quotations - opts = opts.update({"internal", "parseQuotWithCurrentStage"}, false); + opts = opts.update({"internal", "parseQuotWithCurrentStage"}, true); // toggling `parseQuotWithCurrentStage` may also require toggling the following option if macros/syntax // with custom precheck hooks were affected opts = opts.update({"quotPrecheck"}, true);