feat: try to set rule

上级 d0a35918
use crate::inter::IRawRepository;
use crate::inter::{IRawRepository, IRawGrammar};
pub struct RuleFactory {}
......@@ -9,3 +9,14 @@ impl RuleFactory {
pub fn create_capture_rule() {}
}
// todo: trait with types
// https://users.rust-lang.org/t/impl-trait-with-generic-function-for-generic-struct/27083/2
pub trait IRuleRegistry {
fn get_rule(&self, pattern_id: number) -> Rule;
// fn register_rule(&self);
}
pub trait IGrammarRegistry {
fn get_external_grammar(&self, scope_name: String, repository: IRawRepository) -> Option<IRawGrammar>;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册