a structural diff that understands syntax 🟥🟩
 
 
 
 
 
Go to file
Yuya Nishihara 6ba094fa5b exclude more emacs temporary files 2022-07-08 00:01:43 +07:00
.github/workflows github: ensure npm/cargo do the job without 'make generate' (#1) 2022-07-07 13:30:21 +07:00
bindings run cargo fmt 2022-03-03 19:31:38 +07:00
examples bump ref grammar to ba94a296c3ea97c755538ef99efe5d1dd034725c (no change) 2022-06-18 14:18:45 +07:00
queries help emacs indent query comments properly 2022-03-03 19:19:25 +07:00
src add scanner.c which just wraps typescript functions 2021-12-22 18:28:03 +07:00
test add locals query to resolve object id 2021-12-28 18:00:10 +07:00
.gitignore exclude more emacs temporary files 2022-07-08 00:01:43 +07:00
Cargo.toml bump version to 0.1.1 2022-07-07 23:58:16 +07:00
LICENSE add MIT LICENSE text 2021-12-24 18:35:22 +07:00
Makefile make: add clean rule for ease of switching dev/master branches 2022-07-07 23:40:17 +07:00
README.md readme: add build instruction 2022-07-07 23:56:22 +07:00
binding.gyp add scanner.c which just wraps typescript functions 2021-12-22 18:28:03 +07:00
grammar.js bump ref grammar to ba94a296c3ea97c755538ef99efe5d1dd034725c (no change) 2022-06-18 14:18:45 +07:00
package.json bump version to 0.1.1 2022-07-07 23:58:16 +07:00

README.md

tree-sitter-qmljs

QML grammar for the tree-sitter parsing library.

References

Pitfalls

Since grouped binding notation is syntactically ambiguous, it is parsed as an object definition.

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

Building

Use the master branch, which contains all generated files.

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

Hacking

Use the dev branch, but you'll first need to run npm install in the master branch.

$ git checkout master
$ npm install
$ git checkout dev

Generate code and run tests:

$ make generate tests

Make sure example QML files can be parsed:

$ make fetch-examples parse-examples