1 unstable release
new 0.10.0 | Feb 19, 2025 |
---|
#127 in Parser tooling
3.5MB
131K
SLoC
tree-sitter-pascal
Grammar for Pascal and its dialects Delphi and Freepascal.
Supported language features
- Classes, records, interfaces, class helpers
- Nested declarations
- Variant records
- Generics (Delphi- & FPC flavored)
- Anonymous procedures & functions
- Inline assember (but no highlighting)
- Extended RTTI attributes
- FPC PasCocoa extensions
Tree-sitter features:
- Syntax highlighting
- Scopes
Screenshots
(using nvim-treesitter)
lib.rs
:
This crate provides Pascal language support for the tree-sitter parsing library.
Typically, you will use the [LANGUAGE][] constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_pascal::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading Pascal parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());