-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
cec13ab
commit a3999af
Showing
5 changed files
with
81 additions
and
38 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
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,10 +1,12 @@ | ||
pub mod alias; | ||
pub mod printer; | ||
pub mod traverser; | ||
pub mod nushell; | ||
|
||
#[allow(unused)] | ||
pub use printer::print_tree; | ||
#[allow(unused)] | ||
pub use traverser::traverse_tree; | ||
|
||
pub use alias::find_aliases; | ||
pub use nushell::validate_nu_language; |
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,13 @@ | ||
use tree_sitter::Parser; | ||
use tree_sitter_nu::LANGUAGE; | ||
|
||
pub fn validate_nu_language(content: &String) -> bool { | ||
let mut parser = Parser::new(); | ||
let nu_lang = LANGUAGE.into(); | ||
|
||
parser | ||
.set_language(&nu_lang) | ||
.expect("Error loading Nu parser"); | ||
|
||
parser.parse(content, None).is_some() | ||
} |
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