From c7c7c2749af0027577132c8f8d15fa700660fdb4 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Jul 2022 23:30:13 +0900 Subject: [PATCH 1/5] cargo: bump edition to 2021 (no code change) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4faf18c60..855e83062 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" 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" From 4bc26974c172bc1c5916455c8b81d265c28f988a Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Jul 2022 23:34:48 +0900 Subject: [PATCH 2/5] make: add clean rule for ease of switching dev/master branches --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) From 2278c75c9442d9ed9f177e4d60f166f404e8647f Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Jul 2022 23:41:37 +0900 Subject: [PATCH 3/5] readme: add build instruction --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 +``` From 96059d67dfa34958e60e084bf0ff274f7aa52b82 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Jul 2022 23:54:56 +0900 Subject: [PATCH 4/5] bump version to 0.1.1 --- Cargo.toml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 855e83062..94840ac6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [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" 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": { From 6ba094fa5b9adac117297d301d40f980ee545de5 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 7 Jul 2022 23:58:22 +0900 Subject: [PATCH 5/5] exclude more emacs temporary files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 98b733398..53eb142cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ #*# *.orig *~ +.#* +\#*# /Cargo.lock /build/