feat(init): add a title field to grammars
This commit is contained in:
parent
4820d50336
commit
46f8d1267c
7 changed files with 32 additions and 6 deletions
|
|
@ -10,6 +10,6 @@ import (
|
|||
func TestCanLoadGrammar(t *testing.T) {
|
||||
language := tree_sitter.NewLanguage(tree_sitter_LOWER_PARSER_NAME.Language())
|
||||
if language == nil {
|
||||
t.Errorf("Error loading CAMEL_PARSER_NAME grammar")
|
||||
t.Errorf("Error loading TITLE_PARSER_NAME grammar")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
//! let language = tree_sitter_PARSER_NAME::LANGUAGE;
|
||||
//! parser
|
||||
//! .set_language(&language.into())
|
||||
//! .expect("Error loading CAMEL_PARSER_NAME parser");
|
||||
//! .expect("Error loading TITLE_PARSER_NAME parser");
|
||||
//! let tree = parser.parse(code, None).unwrap();
|
||||
//! assert!(!tree.root_node().has_error());
|
||||
//! ```
|
||||
|
|
@ -48,6 +48,6 @@ mod tests {
|
|||
let mut parser = tree_sitter::Parser::new();
|
||||
parser
|
||||
.set_language(&super::LANGUAGE.into())
|
||||
.expect("Error loading CAMEL_PARSER_NAME parser");
|
||||
.expect("Error loading TITLE_PARSER_NAME parser");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from unittest import TestCase
|
||||
|
||||
import tree_sitter, tree_sitter_LOWER_PARSER_NAME
|
||||
import tree_sitter
|
||||
import tree_sitter_LOWER_PARSER_NAME
|
||||
|
||||
|
||||
class TestLanguage(TestCase):
|
||||
|
|
@ -8,4 +9,4 @@ class TestLanguage(TestCase):
|
|||
try:
|
||||
tree_sitter.Language(tree_sitter_LOWER_PARSER_NAME.language())
|
||||
except Exception:
|
||||
self.fail("Error loading CAMEL_PARSER_NAME grammar")
|
||||
self.fail("Error loading TITLE_PARSER_NAME grammar")
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ final class PARSER_CLASS_NAMETests: XCTestCase {
|
|||
let parser = Parser()
|
||||
let language = Language(language: tree_sitter_LOWER_PARSER_NAME())
|
||||
XCTAssertNoThrow(try parser.setLanguage(language),
|
||||
"Error loading CAMEL_PARSER_NAME grammar")
|
||||
"Error loading TITLE_PARSER_NAME grammar")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue