Select the types of activity you want to include in your feed.
loc,json,csv,sexp,toml,xml,opam,rego,sbom: rename Meta.textloc to Meta.loc
Follow up to the loc/json reorg: the [textloc] field of [Meta] is renamed to [loc] across every text-codec consumer. Pure mechanical rename, no behaviour change.
···1853185318541854(* Decoder errors *)
1855185518561856-let[@inline] textloc_of_pos d ~first_byte ~last_byte ~first_line_num
18561856+let[@inline] loc_of_pos d ~first_byte ~last_byte ~first_line_num
18571857 ~first_line_byte ~last_line_num ~last_line_byte =
18581858 Loc.make ~file:d.file ~first_byte ~last_byte ~first_line_num ~first_line_byte
18591859 ~last_line_num ~last_line_byte
···18621862 let first_byte = last_byte_of d in
18631863 let first_line_num = d.line and first_line_byte = d.line_start in
18641864 Meta.make
18651865- @@ textloc_of_pos d ~first_byte ~last_byte:first_byte ~first_line_num
18651865+ @@ loc_of_pos d ~first_byte ~last_byte:first_byte ~first_line_num
18661866 ~first_line_byte ~last_line_num:first_line_num
18671867 ~last_line_byte:first_line_byte
18681868···18701870 let last_byte = last_byte_of d in
18711871 let last_line_num = d.line and last_line_byte = d.line_start in
18721872 Meta.make
18731873- @@ textloc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
18731873+ @@ loc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
18741874 ~last_line_num ~last_line_byte
1875187518761876let err_here d fmt = Error.failf (error_meta d) fmt
···21062106 tokbuf_clear d.ws;
21072107 t
2108210821092109-let textloc_to_current ~first_byte ~first_line_num ~first_line_byte d =
21092109+let loc_to_current ~first_byte ~first_line_num ~first_line_byte d =
21102110 if not d.locs then Loc.none
21112111 else
21122112 let last_byte = last_byte_of d in
21132113 let last_line_num = d.line and last_line_byte = d.line_start in
21142114- textloc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
21142114+ loc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
21152115 ~last_line_num ~last_line_byte
2116211621172117-let textloc_prev_ascii_char ~first_byte ~first_line_num ~first_line_byte d =
21172117+let loc_prev_ascii_char ~first_byte ~first_line_num ~first_line_byte d =
21182118 (* N.B. when we call that the line doesn't move and the char was on
21192119 a single byte *)
21202120 if not d.locs then Loc.none
21212121 else
21222122 let last_byte = last_byte_of d - 1 in
21232123 let last_line_num = d.line and last_line_byte = d.line_start in
21242124- textloc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
21242124+ loc_of_pos d ~first_byte ~last_byte ~first_line_num ~first_line_byte
21252125 ~last_line_num ~last_line_byte
2126212621272127-let meta_make d ?ws_before ?ws_after textloc =
21272127+let meta_make d ?ws_before ?ws_after loc =
21282128 if (not d.locs) && not d.layout then d.meta_none
21292129- else Meta.make ?ws_before ?ws_after textloc
21292129+ else Meta.make ?ws_before ?ws_after loc
2130213021312131(* Decoding *)
21322132···21612161 err_exp_in_const ~first_byte ~first_line_num ~first_line_byte d ~exp:c
21622162 ~fnd:d.u ~const:(ascii_str const)
21632163 done;
21642164- let textloc =
21652165- textloc_to_current d ~first_byte ~first_line_num ~first_line_byte
21642164+ let loc =
21652165+ loc_to_current d ~first_byte ~first_line_num ~first_line_byte
21662166 in
21672167 let ws_after =
21682168 nextc d;
21692169 read_ws d;
21702170 ws_pop d
21712171 in
21722172- meta_make d ~ws_before ~ws_after textloc
21722172+ meta_make d ~ws_before ~ws_after loc
2173217321742174let[@inline] read_json_false d = read_json_const d false_uchars
21752175let[@inline] read_json_true d = read_json_const d true_uchars
···22182218 read_int d;
22192219 read_opt_frac d;
22202220 read_opt_exp d;
22212221- let textloc =
22222222- textloc_prev_ascii_char d ~first_byte ~first_line_num ~first_line_byte
22212221+ let loc =
22222222+ loc_prev_ascii_char d ~first_byte ~first_line_num ~first_line_byte
22232223 in
22242224 let ws_after =
22252225 read_ws d;
22262226 ws_pop d
22272227 in
22282228- meta_make d ~ws_before ~ws_after textloc
22282228+ meta_make d ~ws_before ~ws_after loc
2229222922302230let read_json_string d =
22312231 (* d.u is 0x0022 *)
···23052305 nextc d;
23062306 token_clear d;
23072307 loop d;
23082308- let textloc =
23092309- textloc_to_current d ~first_byte ~first_line_num ~first_line_byte
23082308+ let loc =
23092309+ loc_to_current d ~first_byte ~first_line_num ~first_line_byte
23102310 in
23112311 let ws_after =
23122312 nextc d;
23132313 read_ws d;
23142314 ws_pop d
23152315 in
23162316- meta_make d ~ws_before ~ws_after textloc
23162316+ meta_make d ~ws_before ~ws_after loc
2317231723182318let read_json_name d =
23192319 let meta = read_json_string d in
···25372537 with Error e ->
25382538 Error.adjust_context ~first_byte ~first_line_num ~first_line_byte e)
25392539 in
25402540- let textloc =
25412541- textloc_to_current d ~first_byte ~first_line_num ~first_line_byte
25402540+ let loc =
25412541+ loc_to_current d ~first_byte ~first_line_num ~first_line_byte
25422542 in
25432543 let ws_after =
25442544 nextc d;
25452545 read_ws d;
25462546 ws_pop d
25472547 in
25482548- let meta = meta_make d ~ws_before ~ws_after textloc in
25482548+ let meta = meta_make d ~ws_before ~ws_after loc in
25492549 map.dec_finish meta len b
2550255025512551and decode_object : type a. decoder -> (a, a) object_map -> a =
···25632563 | Error { ctx; meta; kind } when Loc.Context.is_empty ctx ->
25642564 let meta =
25652565 (* This is for when Codec.finish_object_decode raises. *)
25662566- if Loc.is_none (Meta.textloc meta) then
25662566+ if Loc.is_none (Meta.loc meta) then
25672567 error_meta_to_current d ~first_byte ~first_line_num ~first_line_byte
25682568 else meta
25692569 in
···25712571 | Error e ->
25722572 Error.adjust_context ~first_byte ~first_line_num ~first_line_byte e
25732573 in
25742574- let textloc =
25752575- textloc_to_current d ~first_byte ~first_line_num ~first_line_byte
25742574+ let loc =
25752575+ loc_to_current d ~first_byte ~first_line_num ~first_line_byte
25762576 in
25772577 let ws_after =
25782578 nextc d;
25792579 read_ws d;
25802580 ws_pop d
25812581 in
25822582- let meta = meta_make d ~ws_before ~ws_after textloc in
25822582+ let meta = meta_make d ~ws_before ~ws_after loc in
25832583 let dict = Dict.add Codec.object_meta_arg meta dict in
25842584 Codec.apply_dict map.dec dict
25852585
+1-1
test/codecs/jsont_tool.ml
···142142 let pp_locs_outline ppf v =
143143 let indent = 2 in
144144 let loc label ppf m =
145145- pf ppf "@[<v>%s:@,%a@]@," label Loc.pp_ocaml (Json.Meta.textloc m)
145145+ pf ppf "@[<v>%s:@,%a@]@," label Loc.pp_ocaml (Json.Meta.loc m)
146146 in
147147 let rec value ppf = function
148148 | Json.Null ((), m) ->
+1-1
test/codecs/test_jsont_tool.ml
···1414 let cmd = Cmd.(cmd %% path (src_in ~cwd src)) in
1515 Snap.stdout ~cwd ~trim:false cmd !@Fpath.(src -+ ext) ~__POS__
16161717-let test_textlocs =
1717+let test_locs =
1818 Test.test' args "locs" @@ fun (finit, cwd, (_i, valid_srcs)) ->
1919 let cmd = Cmd.(finit % "locs") and ext = ".locs" in
2020 List.iter (snap_stdout ~cwd cmd ~ext) valid_srcs;