Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuja/tree-sitter-qmljs
QML grammar for the tree-sitter parsing library
https://github.com/yuja/tree-sitter-qmljs
parser qml tree-sitter
Last synced: about 2 months ago
JSON representation
QML grammar for the tree-sitter parsing library
- Host: GitHub
- URL: https://github.com/yuja/tree-sitter-qmljs
- Owner: yuja
- License: mit
- Created: 2021-12-24T09:36:47.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-13T03:07:18.000Z (3 months ago)
- Last Synced: 2024-10-26T13:10:16.847Z (2 months ago)
- Topics: parser, qml, tree-sitter
- Language: C
- Homepage:
- Size: 7.04 MB
- Stars: 18
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tree-sitter-qmljs
=================[QML][] grammar for the [tree-sitter][] parsing library.
[QML]: https://doc.qt.io/qt-6/qmlapplications.html
[tree-sitter]: https://github.com/tree-sitter/tree-sitterReferences
----------* https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/parser/qqmljs.g
Pitfalls
--------Since grouped binding notation is syntactically ambiguous, it is parsed as
an object definition.```qml
// (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
```