]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/commitdiff
Simplify dir
authorRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 13:22:05 +0000 (15:22 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 13:22:05 +0000 (15:22 +0200)
Cargo.toml
bindings/rust/lib.rs
example.api [new file with mode: 0644]
package.json

index 3ed407b0d880f2e05ef555febbf839f065ae1ebe..46c2966fca960fa89db913d2c51c8b819ce73d11 100644 (file)
@@ -1,12 +1,12 @@
 [package]
 name = "tree-sitter-api-notation"
 description = "api-notation grammar for the tree-sitter parsing library"
 [package]
 name = "tree-sitter-api-notation"
 description = "api-notation grammar for the tree-sitter parsing library"
-version = "1.0.0"
+version = "0.0.1"
 keywords = ["incremental", "parsing", "api-notation"]
 categories = ["parsing", "text-editors"]
 repository = "https://github.com/tree-sitter/tree-sitter-api-notation"
 edition = "2018"
 keywords = ["incremental", "parsing", "api-notation"]
 categories = ["parsing", "text-editors"]
 repository = "https://github.com/tree-sitter/tree-sitter-api-notation"
 edition = "2018"
-license = "Apache-2.0"
+license = "MIT"
 
 build = "bindings/rust/build.rs"
 include = [
 
 build = "bindings/rust/build.rs"
 include = [
index 7bc923a2259019e8193320d40dce11320a49c479..0bbdddad5abf48f465dd3ef00b201acb2cb21183 100644 (file)
@@ -1,4 +1,4 @@
-//! This crate provides api-notation language support for the [tree-sitter][] parsing library.
+//! This crate provides api_notation language support for the [tree-sitter][] parsing library.
 //!
 //! Typically, you will use the [language][language func] function to add this language to a
 //! tree-sitter [Parser][], and then use the parser to parse some code:
 //!
 //! Typically, you will use the [language][language func] function to add this language to a
 //! tree-sitter [Parser][], and then use the parser to parse some code:
@@ -6,7 +6,7 @@
 //! ```
 //! let code = "";
 //! let mut parser = tree_sitter::Parser::new();
 //! ```
 //! let code = "";
 //! let mut parser = tree_sitter::Parser::new();
-//! parser.set_language(tree_sitter_api_notation::language()).expect("Error loading api-notation grammar");
+//! parser.set_language(tree_sitter_api_notation::language()).expect("Error loading api_notation grammar");
 //! let tree = parser.parse(code, None).unwrap();
 //! ```
 //!
 //! let tree = parser.parse(code, None).unwrap();
 //! ```
 //!
@@ -47,6 +47,6 @@ mod tests {
         let mut parser = tree_sitter::Parser::new();
         parser
             .set_language(super::language())
         let mut parser = tree_sitter::Parser::new();
         parser
             .set_language(super::language())
-            .expect("Error loading api-notation language");
+            .expect("Error loading api_notation language");
     }
 }
     }
 }
diff --git a/example.api b/example.api
new file mode 100644 (file)
index 0000000..37e08d8
--- /dev/null
@@ -0,0 +1,19 @@
+Forum.Models.Post
+  +glyphs <Array<String>>
+  -id <UUID>
+  -created_at <Date>
+  -parent_id <UUID>
+  -text <String>
+  -author <Author>
+  // Comments are also
+  // Allowed in the middle
+  ~>textUpdated(text <String>)
+  ->authorUpdated(author <Author>)
+  <~textWillUpdate(text <String>)
+  <-postWillRender(post <Forum.Models.Post>)
+  +>authorUpdated(author <Author>)
+  <+textWillUpdate(text <String>)
+  ::getAll(parent_id <UUID>) => Promise<Array<Forum.Models.Post>> #> NotFoundError,DisplayError
+  ::get(id <UUID>) => Promise<Forum.Models.Post>
+  #update(text <String>) => Promise<void>
+  #transform([transformer] <Function<T>(T) => boolean>)
index de625549925a2646759d478ea9fed214421ec828..5169fca0ccebaa2105abfc440c3b2e214eb8aa4b 100644 (file)
@@ -16,7 +16,7 @@
     "tree-sitter-cli": "^0.20.8"
   },
   "scripts": {
     "tree-sitter-cli": "^0.20.8"
   },
   "scripts": {
-    "build": "tree-sitter generate && node-gyp build",
+    "build": "tree-sitter generate",
     "parse": "tree-sitter parse",
     "test": "tree-sitter test"
   },
     "parse": "tree-sitter parse",
     "test": "tree-sitter test"
   },