Add .config/helix/.chezmoiignore
Add .config/helix/.gitignore Add .config/helix/runtime/grammars/.gitkeep Add .config/helix/runtime/grammars/astro.so Add .config/helix/runtime/grammars/awk.so Add .config/helix/runtime/grammars/bash.so Add .config/helix/runtime/grammars/bass.so Add .config/helix/runtime/grammars/beancount.so Add .config/helix/runtime/grammars/bibtex.so Add .config/helix/runtime/grammars/bicep.so Add .config/helix/runtime/grammars/blueprint.so Add .config/helix/runtime/grammars/c-sharp.so Add .config/helix/runtime/grammars/c.so Add .config/helix/runtime/grammars/capnp.so Add .config/helix/runtime/grammars/clojure.so Add .config/helix/runtime/grammars/cmake.so Add .config/helix/runtime/grammars/comment.so Add .config/helix/runtime/grammars/cpon.so Add .config/helix/runtime/grammars/cpp.so Add .config/helix/runtime/grammars/css.so Add .config/helix/runtime/grammars/cue.so Add .config/helix/runtime/grammars/d.so Add .config/helix/runtime/grammars/dart.so Add .config/helix/runtime/grammars/devicetree.so Add .config/helix/runtime/grammars/dhall.so Add .config/helix/runtime/grammars/diff.so Add .config/helix/runtime/grammars/dockerfile.so Add .config/helix/runtime/grammars/dot.so Add .config/helix/runtime/grammars/dtd.so Add .config/helix/runtime/grammars/edoc.so Add .config/helix/runtime/grammars/eex.so Add .config/helix/runtime/grammars/elixir.so Add .config/helix/runtime/grammars/elm.so Add .config/helix/runtime/grammars/elvish.so Add .config/helix/runtime/grammars/embedded-template.so Add .config/helix/runtime/grammars/erlang.so Add .config/helix/runtime/grammars/esdl.so Add .config/helix/runtime/grammars/fish.so Add .config/helix/runtime/grammars/forth.so Add .config/helix/runtime/grammars/fortran.so Add .config/helix/runtime/grammars/fsharp.so Add .config/helix/runtime/grammars/gdscript.so Add .config/helix/runtime/grammars/git-commit.so Add .config/helix/runtime/grammars/git-config.so Add .config/helix/runtime/grammars/git-rebase.so Add .config/helix/runtime/grammars/gitattributes.so Add .config/helix/runtime/grammars/gitignore.so Add .config/helix/runtime/grammars/gleam.so Add .config/helix/runtime/grammars/glsl.so Add .config/helix/runtime/grammars/go.so Add .config/helix/runtime/grammars/godot-resource.so Add .config/helix/runtime/grammars/gomod.so Add .config/helix/runtime/grammars/gotmpl.so Add .config/helix/runtime/grammars/gowork.so Add .config/helix/runtime/grammars/graphql.so Add .config/helix/runtime/grammars/hare.so Add .config/helix/runtime/grammars/haskell-persistent.so Add .config/helix/runtime/grammars/haskell.so Add .config/helix/runtime/grammars/hcl.so Add .config/helix/runtime/grammars/heex.so Add .config/helix/runtime/grammars/hosts.so Add .config/helix/runtime/grammars/html.so Add .config/helix/runtime/grammars/hurl.so Add .config/helix/runtime/grammars/iex.so Add .config/helix/runtime/grammars/ini.so Add .config/helix/runtime/grammars/java.so Add .config/helix/runtime/grammars/javascript.so Add .config/helix/runtime/grammars/jinja2.so Add .config/helix/runtime/grammars/jsdoc.so Add .config/helix/runtime/grammars/json.so Add .config/helix/runtime/grammars/jsonnet.so Add .config/helix/runtime/grammars/julia.so Add .config/helix/runtime/grammars/just.so Add .config/helix/runtime/grammars/kdl.so Add .config/helix/runtime/grammars/kotlin.so Add .config/helix/runtime/grammars/latex.so Add .config/helix/runtime/grammars/lean.so Add .config/helix/runtime/grammars/ledger.so Add .config/helix/runtime/grammars/llvm-mir.so Add .config/helix/runtime/grammars/llvm.so Add .config/helix/runtime/grammars/lua.so Add .config/helix/runtime/grammars/make.so Add .config/helix/runtime/grammars/markdoc.so Add .config/helix/runtime/grammars/markdown.so Add .config/helix/runtime/grammars/markdown_inline.so Add .config/helix/runtime/grammars/matlab.so Add .config/helix/runtime/grammars/mermaid.so Add .config/helix/runtime/grammars/meson.so Add .config/helix/runtime/grammars/nasm.so Add .config/helix/runtime/grammars/nickel.so Add .config/helix/runtime/grammars/nim.so Add .config/helix/runtime/grammars/nix.so Add .config/helix/runtime/grammars/nu.so Add .config/helix/runtime/grammars/ocaml-interface.so Add .config/helix/runtime/grammars/ocaml.so Add .config/helix/runtime/grammars/odin.so Add .config/helix/runtime/grammars/opencl.so Add .config/helix/runtime/grammars/openscad.so Add .config/helix/runtime/grammars/org.so Add .config/helix/runtime/grammars/pascal.so Add .config/helix/runtime/grammars/passwd.so Add .config/helix/runtime/grammars/pem.so Add .config/helix/runtime/grammars/perl.so Add .config/helix/runtime/grammars/php.so Add .config/helix/runtime/grammars/po.so Add .config/helix/runtime/grammars/pod.so Add .config/helix/runtime/grammars/ponylang.so Add .config/helix/runtime/grammars/prisma.so Add .config/helix/runtime/grammars/protobuf.so Add .config/helix/runtime/grammars/prql.so Add .config/helix/runtime/grammars/python.so Add .config/helix/runtime/grammars/qmljs.so Add .config/helix/runtime/grammars/r.so Add .config/helix/runtime/grammars/regex.so Add .config/helix/runtime/grammars/rego.so Add .config/helix/runtime/grammars/rescript.so Add .config/helix/runtime/grammars/robot.so Add .config/helix/runtime/grammars/rst.so Add .config/helix/runtime/grammars/ruby.so Add .config/helix/runtime/grammars/rust.so Add .config/helix/runtime/grammars/scala.so Add .config/helix/runtime/grammars/scheme.so Add .config/helix/runtime/grammars/scss.so Add .config/helix/runtime/grammars/slint.so Add .config/helix/runtime/grammars/smithy.so Add .config/helix/runtime/grammars/sml.so Add .config/helix/runtime/grammars/solidity.so Add .config/helix/runtime/grammars/sources/astro/Cargo.toml Add .config/helix/runtime/grammars/sources/astro/README.md Add .config/helix/runtime/grammars/sources/astro/binding.gyp Add .config/helix/runtime/grammars/sources/astro/bindings/node/binding.cc Add .config/helix/runtime/grammars/sources/astro/bindings/node/index.js Add .config/helix/runtime/grammars/sources/astro/bindings/rust/build.rs Add .config/helix/runtime/grammars/sources/astro/bindings/rust/lib.rs Add .config/helix/runtime/grammars/sources/astro/.gitignore Add .config/helix/runtime/grammars/sources/astro/flake.lock Add .config/helix/runtime/grammars/sources/astro/flake.nix Add .config/helix/runtime/grammars/sources/astro/grammar.js Add .config/helix/runtime/grammars/sources/astro/package-lock.json Add .config/helix/runtime/grammars/sources/astro/package.json Add .config/helix/runtime/grammars/sources/astro/queries/highlights.scm Add .config/helix/runtime/grammars/sources/astro/queries/injections.scm Add .config/helix/runtime/grammars/sources/astro/src/grammar.json Add .config/helix/runtime/grammars/sources/astro/src/node-types.json Add .config/helix/runtime/grammars/sources/astro/src/parser.c Add .config/helix/runtime/grammars/sources/astro/src/scanner.cc Add .config/helix/runtime/grammars/sources/astro/src/tag.h Add .config/helix/runtime/grammars/sources/astro/src/tree_sitter/parser.h Add .config/helix/runtime/grammars/sources/astro/test.astro Add .config/helix/runtime/grammars/sources/astro/test2.astro Add .config/helix/runtime/grammars/sources/astro/test3.astro Add .config/helix/runtime/grammars/sources/astro/test4.astro Add .config/helix/runtime/grammars/sources/astro/test5.astro Add .config/helix/runtime/grammars/sources/astro/test6.astro Add .config/helix/runtime/grammars/sources/awk/Cargo.toml Add .config/helix/runtime/grammars/sources/awk/LICENSE Add .config/helix/runtime/grammars/sources/awk/README.md Add .config/helix/runtime/grammars/sources/awk/binding.gyp Add .config/helix/runtime/grammars/sources/awk/bindings/node/binding.cc Add .config/helix/runtime/grammars/sources/awk/bindings/node/index.js Add .config/helix/runtime/grammars/sources/awk/bindings/rust/build.rs Add .config/helix/runtime/grammars/sources/awk/bindings/rust/lib.rs Add .config/helix/runtime/grammars/sources/awk/.github/workflows/tests.yml Add .config/helix/runtime/grammars/sources/awk/.gitignore Add .config/helix/runtime/grammars/sources/awk/.npmignore Add .config/helix/runtime/grammars/sources/awk/.prettierrc Add .config/helix/runtime/grammars/sources/awk/.vscode/launch.json Add .config/helix/runtime/grammars/sources/awk/examples/example.awk Add .config/helix/runtime/grammars/sources/awk/grammar.d.ts Add .config/helix/runtime/grammars/sources/awk/grammar.js Add .config/helix/runtime/grammars/sources/awk/jsconfig.json Add .config/helix/runtime/grammars/sources/awk/package.json Add .config/helix/runtime/grammars/sources/awk/queries/highlights.scm Add .config/helix/runtime/grammars/sources/awk/scripts/update_highlights_version.sh Add .config/helix/runtime/grammars/sources/awk/scripts/generate_types.js Add .config/helix/runtime/grammars/sources/awk/scripts/generate_types_watch.js Add .config/helix/runtime/grammars/sources/awk/src/grammar.json Add .config/helix/runtime/grammars/sources/awk/src/node-types.json Add .config/helix/runtime/grammars/sources/awk/src/parser.c Add .config/helix/runtime/grammars/sources/awk/src/scanner.c Add .config/helix/runtime/grammars/sources/awk/src/tree_sitter/parser.h Add .config/helix/runtime/grammars/sources/awk/test/corpus/crlf.txt Add .config/helix/runtime/grammars/sources/awk/test/corpus/expression.txt Add .config/helix/runtime/grammars/sources/awk/test/corpus/function.txt Add .config/helix/runtime/grammars/sources/awk/test/corpus/pattern.txt Add .config/helix/runtime/grammars/sources/awk/test/corpus/program.txt Add .config/helix/runtime/grammars/sources/awk/test/corpus/statement.txt Add .config/helix/runtime/grammars/sources/awk/yarn.lock Add .config/helix/runtime/grammars/sources/bash/Cargo.toml Add .config/helix/runtime/grammars/sources/bash/LICENSE Add .config/helix/runtime/grammars/sources/bash/.gitattributes Add .config/helix/runtime/grammars/sources/bash/.github/workflows/ci.yml Add .config/helix/runtime/grammars/sources/bash/.gitignore Add .config/helix/runtime/grammars/sources/bash/.gitmodules Add .config/helix/runtime/grammars/sources/bash/.npmignore Add .config/helix/runtime/grammars/sources/bash/.travis.yml Remove .config/helix/runtime
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
fn main() {
|
||||
let src_dir = std::path::Path::new("src");
|
||||
|
||||
let mut c_config = cc::Build::new();
|
||||
c_config.include(&src_dir);
|
||||
c_config
|
||||
.flag_if_supported("-Wno-unused-parameter")
|
||||
.flag_if_supported("-Wno-unused-but-set-variable")
|
||||
.flag_if_supported("-Wno-trigraphs");
|
||||
let parser_path = src_dir.join("parser.c");
|
||||
c_config.file(&parser_path);
|
||||
|
||||
// If your language uses an external scanner written in C,
|
||||
// then include this block of code:
|
||||
|
||||
/*
|
||||
let scanner_path = src_dir.join("scanner.c");
|
||||
c_config.file(&scanner_path);
|
||||
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
||||
*/
|
||||
|
||||
c_config.compile("parser");
|
||||
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
|
||||
|
||||
// If your language uses an external scanner written in C++,
|
||||
// then include this block of code:
|
||||
|
||||
/*
|
||||
let mut cpp_config = cc::Build::new();
|
||||
cpp_config.cpp(true);
|
||||
cpp_config.include(&src_dir);
|
||||
cpp_config
|
||||
.flag_if_supported("-Wno-unused-parameter")
|
||||
.flag_if_supported("-Wno-unused-but-set-variable");
|
||||
let scanner_path = src_dir.join("scanner.cc");
|
||||
cpp_config.file(&scanner_path);
|
||||
cpp_config.compile("scanner");
|
||||
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
||||
*/
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
//! This crate provides astro 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:
|
||||
//!
|
||||
//! ```
|
||||
//! let code = "";
|
||||
//! let mut parser = tree_sitter::Parser::new();
|
||||
//! parser.set_language(tree_sitter_astro::language()).expect("Error loading astro grammar");
|
||||
//! let tree = parser.parse(code, None).unwrap();
|
||||
//! ```
|
||||
//!
|
||||
//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
|
||||
//! [language func]: fn.language.html
|
||||
//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html
|
||||
//! [tree-sitter]: https://tree-sitter.github.io/
|
||||
|
||||
use tree_sitter::Language;
|
||||
|
||||
extern "C" {
|
||||
fn tree_sitter_astro() -> Language;
|
||||
}
|
||||
|
||||
/// Get the tree-sitter [Language][] for this grammar.
|
||||
///
|
||||
/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
|
||||
pub fn language() -> Language {
|
||||
unsafe { tree_sitter_astro() }
|
||||
}
|
||||
|
||||
/// The content of the [`node-types.json`][] file for this grammar.
|
||||
///
|
||||
/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types
|
||||
pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json");
|
||||
|
||||
// Uncomment these to include any queries that this grammar contains
|
||||
|
||||
// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm");
|
||||
// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm");
|
||||
// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm");
|
||||
// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm");
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_can_load_grammar() {
|
||||
let mut parser = tree_sitter::Parser::new();
|
||||
parser
|
||||
.set_language(super::language())
|
||||
.expect("Error loading astro language");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user