diff --git a/.gitignore b/.gitignore index 3d9acbfde..b80a110e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ #*# *.orig *~ +.#* +\#*# /Cargo.lock /build/ diff --git a/Cargo.toml b/Cargo.toml index 4faf18c60..94840ac6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/Makefile b/Makefile index aa668e00e..f73dae7ca 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/README.md b/README.md index 5af29375e..a91120993 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/package.json b/package.json index ac06c35c0..4b21761b6 100644 --- a/package.json +++ b/package.json @@ -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": {