{"id":19773208,"url":"https://github.com/mbarbin/loc","last_synced_at":"2026-01-25T16:13:07.389Z","repository":{"id":206862030,"uuid":"717856105","full_name":"mbarbin/loc","owner":"mbarbin","description":"Representing ranges of lexing positions from parsed files","archived":false,"fork":false,"pushed_at":"2026-01-23T12:58:55.000Z","size":194,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T04:57:14.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mbarbin.github.io/loc/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbarbin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"COPYING.HEADER","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-12T20:06:31.000Z","updated_at":"2026-01-23T12:58:59.000Z","dependencies_parsed_at":"2024-03-13T10:27:54.733Z","dependency_job_id":"f9961f3e-b030-4748-8071-fa4a9f9206c1","html_url":"https://github.com/mbarbin/loc","commit_stats":null,"previous_names":["mbarbin/loc"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mbarbin/loc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbarbin%2Floc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbarbin%2Floc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbarbin%2Floc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbarbin%2Floc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbarbin","download_url":"https://codeload.github.com/mbarbin/loc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbarbin%2Floc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T05:08:58.643Z","updated_at":"2026-01-25T16:13:07.367Z","avatar_url":"https://github.com/mbarbin.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loc\n\n[![CI Status](https://github.com/mbarbin/loc/workflows/ci/badge.svg)](https://github.com/mbarbin/loc/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/mbarbin/loc/badge.svg?branch=main)](https://coveralls.io/github/mbarbin/loc?branch=main)\n\nLoc is an OCaml library to manipulate code locations, which are ranges of lexing positions from a parsed file.\n\nIt is inspired by dune's `Loc.t`, and uses it under the hood. The type equality with `Stdune.Loc.t` is currently not exposed and `Stdune` not mentioned in the interface of `Loc`, with the aim of keeping the signature of `Loc` stable across potential internal changes in `Stdune`.\n\n## Code Documentation\n\nThe code documentation of the latest release is built with `odoc` and published to `GitHub` pages [here](https://mbarbin.github.io/loc).\n\n## Motivation\n\nAttaching locations to nodes manipulated by programs can be useful for applications such as compilers, interpreters, linters, refactor tools, etc.\n\nHere are 3 kinds of examples using the `Loc` library:\n\n1. Attach locations to the nodes of an AST. See [bopkit](https://github.com/mbarbin/bopkit/blob/main/lib/bopkit/src/netlist.mli).\n2. Apply surgical patches to a file. See [file-rewriter](https://github.com/mbarbin/file-rewriter).\n3. Emit located messages to the console. See cmdlang's [Err](https://github.com/mbarbin/cmdlang/blob/main/lib/err/src/err.mli) module.\n\n## See also\n\nSimilar libraries or modules:\n\n- Dune's [Loc.t](https://github.com/ocaml/dune/blob/dedfb76837bad6ea6de97de07e61f2ac10442127/otherlibs/stdune/src/loc.mli#L1)\n\n- Parsexp's [ranges](https://github.com/janestreet/parsexp/blob/14af9ab942251783de6abb20e0d0e0eec6080062/src/positions.mli#L59)\n\n- Ppxlib's [Location.t](https://github.com/ocaml-ppx/ppxlib/blob/456d1a99d354f8b3f34f01d1a7b61dc43ef678b6/src/location.ml#L4)\n\n- Compilerlibs's [loc](https://github.com/ocaml/ocaml/blob/81003f23918729fa730c01ccffec25939cd730ff/utils/warnings.mli#L23)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbarbin%2Floc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbarbin%2Floc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbarbin%2Floc/lists"}