-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
76 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
[package] | ||
name = "tree-sitter-html" | ||
description = "html grammar for the tree-sitter parsing library" | ||
description = "HTML grammar for tree-sitter" | ||
version = "0.19.0" | ||
authors = [ | ||
"Max Brunsfeld <maxbrunsfeld@gmail.com>", | ||
"Amaan Qureshi <amaanq12@gmail.com>", | ||
] | ||
license = "MIT" | ||
readme = "bindings/rust/README.md" | ||
keywords = ["incremental", "parsing", "html"] | ||
categories = ["parsing", "text-editors"] | ||
repository = "https://github.com/tree-sitter/tree-sitter-html" | ||
edition = "2018" | ||
edition = "2021" | ||
autoexamples = false | ||
|
||
build = "bindings/rust/build.rs" | ||
include = [ | ||
"bindings/rust/*", | ||
"grammar.js", | ||
"queries/*", | ||
"src/*", | ||
] | ||
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] | ||
|
||
[lib] | ||
path = "bindings/rust/lib.rs" | ||
|
||
[dependencies] | ||
tree-sitter = "0.19" | ||
tree-sitter = "~0.20.10" | ||
|
||
[build-dependencies] | ||
cc = "1.0" | ||
cc = "~1.0.83" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
try { | ||
module.exports = require("../../build/Release/tree_sitter_html_binding"); | ||
module.exports = require('../../build/Release/tree_sitter_html_binding'); | ||
} catch (error1) { | ||
if (error1.code !== 'MODULE_NOT_FOUND') { | ||
throw error1; | ||
} | ||
try { | ||
module.exports = require("../../build/Debug/tree_sitter_html_binding"); | ||
module.exports = require('../../build/Debug/tree_sitter_html_binding'); | ||
} catch (error2) { | ||
if (error2.code !== 'MODULE_NOT_FOUND') { | ||
throw error2; | ||
} | ||
throw error1 | ||
throw error1; | ||
} | ||
} | ||
|
||
try { | ||
module.exports.nodeTypeInfo = require("../../src/node-types.json"); | ||
module.exports.nodeTypeInfo = require('../../src/node-types.json'); | ||
} catch (_) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# tree-sitter-html | ||
|
||
This crate provides a HTML grammar for the [tree-sitter][] parsing library. | ||
To use this crate, add it to the `[dependencies]` section of your `Cargo.toml` | ||
file. (Note that you will probably also need to depend on the | ||
[`tree-sitter`][tree-sitter crate] crate to use the parsed result in any useful | ||
way.) | ||
|
||
```toml | ||
[dependencies] | ||
tree-sitter = "0.20.10" | ||
tree-sitter-html = "0.19.0" | ||
``` | ||
|
||
Typically, you will use the [language][language func] function to add this | ||
grammar to a tree-sitter [Parser][], and then use the parser to parse some code: | ||
|
||
```rust | ||
let code = r#" | ||
def double(x): | ||
return x * 2 | ||
"#; | ||
let mut parser = Parser::new(); | ||
parser.set_language(tree_sitter_html::language()).expect("Error loading HTML grammar"); | ||
let parsed = parser.parse(code, None); | ||
``` | ||
|
||
If you have any questions, please reach out to us in the [tree-sitter | ||
discussions] page. | ||
|
||
[language func]: https://docs.rs/tree-sitter-html/*/tree_sitter_html/fn.language.html | ||
[Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html | ||
[tree-sitter]: https://tree-sitter.github.io/ | ||
[tree-sitter crate]: https://crates.io/crates/tree-sitter | ||
[tree-sitter discussions]: https://github.com/tree-sitter/tree-sitter/discussions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include "tag.h" | ||
|
||
#include <wctype.h> | ||
|
||
enum TokenType { | ||
|
File renamed without changes.