merge with dev

pull/361/head
Yuya Nishihara 2022-07-08 00:17:44 +07:00
commit 3bcf9c4d09
5 changed files with 51 additions and 3 deletions

2
.gitignore vendored

@ -1,6 +1,8 @@
#*#
*.orig
*~
.#*
\#*#
/Cargo.lock
/build/

@ -1,11 +1,11 @@
[package]
name = "tree-sitter-qmljs"
description = "QML grammar for the tree-sitter parsing library"
version = "0.1.0"
version = "0.1.1"
keywords = ["incremental", "parsing", "qml"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/yuja/tree-sitter-qmljs"
edition = "2018"
edition = "2021"
license = "MIT"
build = "bindings/rust/build.rs"

@ -5,6 +5,7 @@ TREE_SITTER = node_modules/.bin/tree-sitter
help:
@echo 'Make targets:'
@echo ' generate - generate parser sources'
@echo ' clean - remove build directory and intermediate files'
@echo ' tests - run all tests'
@echo ' fetch-examples - fetch example repositories'
@echo ' parse-examples - parse example files'
@ -36,6 +37,18 @@ src/typescript-scanner.h: \
cat $<; \
) > $@
.PHONY: clean
clean:
$(RM) -R build target
$(RM) \
queries/highlights-javascript.scm \
queries/highlights-typescript.scm \
src/grammar.json \
src/node-types.json \
src/parser.c \
src/tree_sitter/parser.h \
src/typescript-scanner.h
.PHONY: tests
tests:
$(TREE_SITTER) test $(TESTFLAGS)

@ -24,3 +24,36 @@ Button {
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
```

@ -1,6 +1,6 @@
{
"name": "tree-sitter-qmljs",
"version": "0.1.0",
"version": "0.1.1",
"description": "QML grammar for the tree-sitter parsing library",
"main": "bindings/node",
"scripts": {