#解析器 #增量 #QML

tree-sitter-qmljs

tree-sitter解析库的QML语法

3个版本

0.1.2 2022年10月12日
0.1.1 2022年7月7日
0.1.0 2021年12月29日

文本编辑器 中排名 233

Download history · Rust 包仓库 17/week @ 2024-03-17 · Rust 包仓库 56/week @ 2024-03-24 · Rust 包仓库 48/week @ 2024-03-31 · Rust 包仓库 6/week @ 2024-04-07 · Rust 包仓库 115/week @ 2024-04-14 · Rust 包仓库 12/week @ 2024-04-21 · Rust 包仓库 16/week @ 2024-04-28 · Rust 包仓库 49/week @ 2024-05-05 · Rust 包仓库 50/week @ 2024-05-12 · Rust 包仓库 19/week @ 2024-05-19 · Rust 包仓库 13/week @ 2024-05-26 · Rust 包仓库 8/week @ 2024-06-02 · Rust 包仓库 22/week @ 2024-06-09 · Rust 包仓库 3/week @ 2024-06-16 · Rust 包仓库 45/week @ 2024-06-23 · Rust 包仓库 29/week @ 2024-06-30 · Rust 包仓库

每月下载量 99

MIT 许可证

8MB
253K SLoC

C 252K SLoC · Rust 包仓库 JavaScript 264 SLoC // 0.1% comments · Rust 包仓库 Scheme 231 SLoC // 0.1% comments · Rust 包仓库 Rust 44 SLoC // 0.1% comments · Rust 包仓库

tree-sitter-qmljs

QML 语法用于 tree-sitter 解析库。

参考

陷阱

由于分组绑定符号在语法上存在歧义,因此它被解析为对象定义。

// (ui_object_definition type_name: (identifier "Button") ...)
Button {
    // (ui_object_definition type_name: (identifier "icon") ...)
    icon { source: "foo.png"; color: "transparent" }
}

构建

使用包含所有生成文件的 master 分支。

$ git checkout master
$ npm install
$ cargo build --release

开发

使用 dev 分支,但您首先需要在 master 分支中运行 npm install

$ git checkout master
$ npm install
$ git checkout dev

生成代码和运行测试

$ make generate tests

确保示例QML文件可以被解析

$ make fetch-examples parse-examples

依赖关系

~2.7–4MB
~71K SLoC