Metadata-Version: 2.4
Name: tree-sitter-qmljs
Version: 0.3.1
Summary: QML grammar for tree-sitter
License: MIT
Project-URL: Homepage, https://github.com/yuja/tree-sitter-qmljs
Keywords: incremental,parsing,tree-sitter,qml
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: core
Requires-Dist: tree-sitter~=0.21; extra == "core"
Dynamic: license-file

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-sitter

References
----------

* 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
```
