Add a highlight subcommand
This commit is contained in:
parent
0dd15e2b02
commit
e89b6b2402
14 changed files with 1870 additions and 22 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use std::io;
|
||||
use tree_sitter_highlight::PropertySheetError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Error(pub String);
|
||||
|
|
@ -42,3 +43,13 @@ impl From<String> for Error {
|
|||
Error(error)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PropertySheetError> for Error {
|
||||
fn from(error: PropertySheetError) -> Self {
|
||||
match error {
|
||||
PropertySheetError::InvalidFormat(e) => Self::from(e),
|
||||
PropertySheetError::InvalidRegex(e) => Self::regex(&e.to_string()),
|
||||
PropertySheetError::InvalidJSON(e) => Self::from(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue