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

ocaml-tree-sitter displays different behavior to tree-sitter #79

Open
patrick-nicodemus opened this issue Jun 13, 2024 · 0 comments
Open

Comments

@patrick-nicodemus
Copy link

I started trying to set up ocaml-tree-sitter to work with https://github.com/milisims/tree-sitter-org. I ran into one problem mentioned in another issue #78, however I patched that one just by renaming "non-immediate" to "nonimmediate" everywhere.

The next issue I ran into is the following.

org: Importing initial 'grammar.json'.
org: Simplifying 'grammar.json' for ocaml-tree-sitter.
org: Recovering informational JS grammars from JSON.
org: Generating definitive 'parser.c'.
Unresolved conflict for symbol sequence:

  multiline_text_repeat1  •  ':'  …

Possible interpretations:

  1:  (multiline_text  multiline_text_repeat1)  •  ':'  …
  2:  (multiline_text_repeat1  multiline_text_repeat1  •  multiline_text_repeat1)

Possible resolutions:

  1:  Specify a left or right associativity in `multiline_text`
  2:  Add a conflict for these rules: `multiline_text`

Now it may be that there is a problem with the original grammar, and I should take it up with the administrators of the grammar repository, but if I run the tree-sitter CLI on the grammar.js in the org grammar repository, I don't get any warnings or complaints, and so I was wondering if there's a difference in how the files are processed.

(I tried running the OCaml code generation tool directly on the C file that is in the org grammar git repository, and it gave an OCaml program which compiled fine, but it didn't work correctly on my test data. I presume this is to be expected because it's not how the tool is designed to be used.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant