Skip to content

foxyseta/tree-sitter-prolog

Repository files navigation

tree-sitter-prolog

status-badge

Prolog grammar for Tree-sitter. The "References" section lists the various extensions that currently have their own grammar besides ISO Prolog.

Feel free to contribute with new ones! It is super easy, as you can just extend an existing one. See .woodpecker.yml for the current version of Tree-sitter we are testing against.

Project structure

The project uses pnpm as its package manager. Files package.json, tree-sitter.json, and pnpm-lock.yaml can be found in the root folder.

Grammars

A grammar.js file for a Prolog extension xxx is located at grammars/xxx/grammar.js. They are formatted using dprint, according to grammars/dprint.json.

Parsers

Parser sources for a Prolog extension xxx are located at grammars/xxx/src/. If you are not using the generate pnpm script and are manually invoking the tree-sitter generate command instead, make sure your current directory is grammars/xxx/.

Queries

If a .scm file does not need modifications between two or more grammars, it can be found in queries/. Otherwise, its version for grammar xxx is located at grammars/xxx/queries/.

Tests

Corpus tests for a grammar xxx are located at grammars/xxx/tests/corpus/. Highlight tests of all grammars are located at tests/highlight/.

References

ISO Prolog

ProbLog

Contributors 4

  •  
  •  
  •  
  •