From 6f6cf93bf2efc07824c383f8b20c776c9b99a749 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 22 Aug 2023 19:56:12 -0400 Subject: [PATCH] Add example; Fix config --- .gitignore | 1 + Cargo.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- example.dust | 12 ++++++++ highlights.scm | 6 ++-- package.json | 2 +- 6 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 Cargo.lock create mode 100644 example.dust diff --git a/.gitignore b/.gitignore index c2658d7..aa8afe6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +target/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..567cf01 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,80 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +dependencies = [ + "memchr", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "regex" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "tree-sitter" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +dependencies = [ + "cc", + "regex", +] + +[[package]] +name = "tree-sitter-Dust" +version = "0.0.1" +dependencies = [ + "cc", + "tree-sitter", +] diff --git a/Cargo.toml b/Cargo.toml index ddb8084..744b3e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tree-sitter-Dust" +name = "tree-sitter-dust" description = "Dust grammar for the tree-sitter parsing library" version = "0.0.1" keywords = ["incremental", "parsing", "Dust"] diff --git a/example.dust b/example.dust new file mode 100644 index 0000000..a252616 --- /dev/null +++ b/example.dust @@ -0,0 +1,12 @@ +# Lists are created by grouping items in partheses and separating them with +# commas. + +numbers = (1, 2, 3); + +# To access the values in a list, use an integer as an index. + +x = numbers.0; +y = numbers.1; +z = numbers.2; + +assert_equal(x + y, z); diff --git a/highlights.scm b/highlights.scm index a55b167..d7f8107 100644 --- a/highlights.scm +++ b/highlights.scm @@ -1,5 +1,5 @@ -(comment) @comment +(comment) @commenqt (operator) @operator -(integer) @number.integer +(integer) @number (string) @string -(macro) @functions.builtin +(macro) @function.builtin diff --git a/package.json b/package.json index 999470a..65bfd6e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "", + "author": "Jeff Anderson", "license": "ISC", "tree-sitter": [ {