@@ -81,7 +81,7 @@ structure FreeSyntaxConfig where
8181 name : Name
8282 «open » : Bool := true
8383 label : Option String := none
84- title : (FileMap × TSyntaxArray `inline)
84+ title : TSyntaxArray `inline
8585
8686def FreeSyntaxConfig.getLabel (config : FreeSyntaxConfig) : String :=
8787 config.label.getD <|
@@ -830,7 +830,7 @@ where
830830 return bar ++ .nest 2 (← production which stx |>.run' {})
831831
832832def testGetBnf (config : FreeSyntaxConfig) (isFirst : Bool) (stxs : List Syntax) : TermElabM String := do
833- let (tagged, _) ← getBnf config isFirst stxs |>.run ⟨default, default, default, default⟩ {} {partContext := ⟨⟨default, default, default, default, default⟩, default⟩}
833+ let (tagged, _) ← getBnf config isFirst stxs |>.run ⟨default, default, default, default⟩ {} {partContext := ⟨⟨default, default, default, default, default, default ⟩, default⟩}
834834 pure tagged.stripTags
835835
836836namespace Tests
@@ -841,7 +841,7 @@ def selectedParser : Parser := leading_parser
841841
842842
843843elab "#test_syntax" arg:selectedParser : command => do
844- let bnf ← Command.liftTermElabM (testGetBnf {name := (TSyntax.mk arg.raw[0 ]).getId, title := (FileMap.ofString "" , #[]) } true [arg.raw[2 ]])
844+ let bnf ← Command.liftTermElabM (testGetBnf { name := (TSyntax.mk arg.raw[0 ]).getId, title := #[] } true [arg.raw[2 ]])
845845 logInfo bnf
846846
847847/--
@@ -867,7 +867,7 @@ info: term ::= ...
867867
868868
869869elab "#test_free_syntax" x:ident arg:free_syntaxes : command => do
870- let bnf ← Command.liftTermElabM (testGetBnf {name := x.getId, title := (FileMap.ofString "" , #[]) } true (FreeSyntax.decodeMany arg |>.map FreeSyntax.decode))
870+ let bnf ← Command.liftTermElabM (testGetBnf { name := x.getId, title := #[] } true (FreeSyntax.decodeMany arg |>.map FreeSyntax.decode))
871871 logInfo bnf
872872
873873/--
@@ -1084,12 +1084,10 @@ def «syntax» : DirectiveExpander
10841084 | args, blocks => do
10851085 let config ← SyntaxConfig.parse.run args
10861086
1087- let title ← do
1088- let (fm, t) := config.title
1089- DocElabM.withFileMap fm <| t.mapM elabInline
1087+ let title ← config.title.mapM elabInline
10901088
10911089 let env ← getEnv
1092- let titleString := inlinesToString env (config.title.snd )
1090+ let titleString := inlinesToString env (config.title)
10931091
10941092 let mut content := #[]
10951093 let mut firstGrammar := true
@@ -1102,8 +1100,7 @@ def «syntax» : DirectiveExpander
11021100 | _ =>
11031101 content := content.push <| ← elabBlock b
11041102
1105- Doc.PointOfInterest.save (← getRef) titleString
1106- (selectionRange := (← getRef)[0 ])
1103+ Doc.PointOfInterest.save (← getRef) titleString (selectionSyntax? := some (← getRef)[0 ])
11071104
11081105 pure #[← `(Block.other {Block.syntax with data := ToJson.toJson (α := Option String × Name × String × Option Tag × Array Name) ($(quote titleString), $(quote config.name), $(quote config.getLabel), none, $(quote config.aliases.toArray))} #[Block.para #[$(title),*], $content,*])]
11091106where
@@ -1161,11 +1158,9 @@ def freeSyntax : DirectiveExpander
11611158 | args, blocks => do
11621159 let config ← FreeSyntaxConfig.parse.run args
11631160
1164- let title ← do
1165- let (fm, t) := config.title
1166- DocElabM.withFileMap fm <| t.mapM elabInline
1161+ let title ← config.title.mapM elabInline
11671162 let env ← getEnv
1168- let titleString := inlinesToString env config.title.snd
1163+ let titleString := inlinesToString env config.title
11691164
11701165 let mut content := #[]
11711166 let mut firstGrammar := true
0 commit comments