File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -233,8 +233,17 @@ let mk_name ~lines (id : Names.lname) : Lang.Ast.Name.t Lang.With_range.t =
233233let mk_id ~lines (id : Names.lident ) =
234234 CAst. map (fun id -> Names. Name id) id |> mk_name ~lines
235235
236- let mk_string ~lines (id : Names.lstring ) =
237- CAst. map (fun id -> Names. (Name (Id. of_string_soft id))) id |> mk_name ~lines
236+ (* Cleanup ntn_decl *)
237+ let mk_from_ntn_decl ~lines (id : Names.lstring ) =
238+ CAst. with_loc_val
239+ (fun ?loc str ->
240+ let loc = Option. get loc in
241+ let range = Utils. to_range ~lines loc in
242+ (* Notation cleanup *)
243+ let strs = String. split_on_char '\' ' str in
244+ let v = Some (String. concat " " strs) in
245+ Lang.With_range. { range; v })
246+ id
238247
239248let constructor_info ~lines ((_ , (id , _typ )) : constructor_expr ) =
240249 let range = Option. get id.loc in
@@ -348,7 +357,7 @@ let make_info ~st:_ ~lines CAst.{ loc; v } : Lang.Ast.Info.t list option =
348357 let detail = " Rewrite Rule" in
349358 Some [ Lang.Ast.Info. make ~range ~name ~kind ~detail () ]
350359 | VernacSynterp (VernacNotation (_infix , { ntn_decl_string; _ } )) ->
351- let name = mk_string ~lines ntn_decl_string in
360+ let name = mk_from_ntn_decl ~lines ntn_decl_string in
352361 let kind = Kinds. operator in
353362 let detail = " Notation" in
354363 Some [ Lang.Ast.Info. make ~range ~name ~kind ~detail () ]
You can’t perform that action at this time.
0 commit comments