Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split into core repo and grammars #204

Open
6 of 7 tasks
mjambon opened this issue May 17, 2021 · 1 comment
Open
6 of 7 tasks

Split into core repo and grammars #204

mjambon opened this issue May 17, 2021 · 1 comment
Assignees
Labels
priority:low not on the roadmap for now tech debt works for now but fragile

Comments

@mjambon
Copy link
Member

mjambon commented May 17, 2021

Goal: make it simple to use the ocaml-tree-sitter runtime library as a git submodule without pulling the big tree-sitter-* submodules that contain generated files for real-world languages.

Proposed split:

  • ocaml-tree-sitter-core repo containing:
    • src and scripts folders with all the machinery for code generation and runtime
    • tests folder with the end-to-end tests on simple grammars
  • ocaml-tree-sitter-semgrep repo containing:
    • lang folder which wraps around real-world grammars and includes tree-sitter-* repos as submodules
    • ocaml-tree-sitter-core repo as a submodule
  • ocaml-tree-sitter-languages repo: similar to ocaml-tree-sitter-semgrep but without the grammar extensions for semgrep patterns. This is for the community of users of tree-sitter and ocaml, independently from semgrep.

Two-step plan

Phase 1

  1. Clone ocaml-tree-sitter to ocaml-tree-sitter-core.
  2. Remove the languages from the lang/ folder in ocaml-tree-sitter-core.
  3. Create core submodule in ocaml-tree-sitter. Remove duplicate code. Create symlinks to core as needed.

Phase 2

  1. Rename ocaml-tree-sitter → ocaml-tree-sitter-semgrep.
  2. Make semgrep use ocaml-tree-sitter-core instead of ocaml-tree-sitter.
  3. Create community repo ocaml-tree-sitter-languages on the same model as ocaml-tree-sitter-semgrep.

[Phase 3 - later]

Simplify the structure of the repos, minimize reliance on symlinks.

Progress

  • phase 1
  • phase 2.1
  • phase 2.2
  • phase 2.3
  • update documentation in ocaml-tree-sitter-core
  • update documentation in ocaml-tree-sitter-semgrep
  • update links to documentation from semgrep
@mjambon mjambon added priority:low not on the roadmap for now tech debt works for now but fragile labels May 17, 2021
@mjambon mjambon self-assigned this May 17, 2021
@aryx
Copy link
Collaborator

aryx commented May 18, 2021

Yep, sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low not on the roadmap for now tech debt works for now but fragile
Development

No branches or pull requests

2 participants