Skip to content

graphrag/tree-sitter-gram

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-sitter-gram

A tree-sitter grammar for gram notation.

Gram is a subject-based notation for structured data.

If this is an object:

{
  "name":"Andreas",
  "roles":["author"]
}

Implicitly the object is a person. To become a subject, the implicit information can be explicit.

As a subject:

(:Person {
  name: "Andreas",
  roles: ["author"]
})

Gram files support comments using // syntax for line-based and end-of-line comments:

// This is a line comment
(hello)-->(world)  // End-of-line comment

Learn more about gram at the gram-data github org notation.

Editor Support

This repository includes editor integrations for syntax highlighting and language support:

  • Zed Editor - Full syntax highlighting and language support
  • More editors coming soon! Contributions welcome.

See editors/README.md for installation instructions and available features.

Language Bindings

Tree-sitter bindings are available for multiple languages:

  • Node.js: npm install @gram-data/tree-sitter-gram
  • Rust: Available via Cargo.toml
  • Python: Install via pip install .
  • Go: Import from this repository
  • Swift: Available via Swift Package Manager
  • C: Build with included Makefile

Development

Generate the parser after grammar changes:

npx tree-sitter generate
npx tree-sitter test

Run language binding tests:

npm test                    # Node.js bindings
cargo test                  # Rust bindings
python -m pytest           # Python bindings
make test                   # C bindings

See DEVELOP.md for detailed development guidelines.

About

Tree-sitter based grammar and parser for gram, a graph serialization format

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 79.0%
  • JavaScript 16.2%
  • Tree-sitter Query 4.8%