fea: init scope metadata

上级 f385bf00
pub mod stack_element;
pub mod scope_list_element;
pub mod scope_metadata;
use crate::inter::{IRawGrammar, IRawRepository, ILocation, IRawRule, IRawRepositoryMap};
use crate::rule::{RuleFactory, IRuleFactoryHelper, IGrammarRegistry, IRuleRegistry, Rule, AbstractRule, BeginEndRule};
......
......@@ -2,4 +2,20 @@ pub struct ScopeListElement {
pub parent: Option<Box<ScopeListElement>>,
pub scope: String,
pub metadata: i32
}
impl ScopeListElement {
pub fn new(parent: Option<Box<ScopeListElement>>, scope: String, metadata: i32) -> Self {
ScopeListElement { parent, scope, metadata }
}
}
impl Default for ScopeListElement {
fn default() -> Self {
ScopeListElement {
parent: None,
scope: "".to_string(),
metadata: 0
}
}
}
\ No newline at end of file
pub enum TemporaryStandardTokenType {
Other,
Comment,
String,
RegEx,
MetaEmbedded
}
pub struct ScopeMetadata {
pub scope_name: i32,
pub language_id: i32,
pub token_type: TemporaryStandardTokenType,
}
pub struct ScopeMetadataProvider {
}
......@@ -152,7 +152,7 @@ pub struct IRawGrammar {
pub repository: Option<IRawRepository>,
pub location: Option<ILocatable>,
#[serde(alias = "scopeName")]
#[serde(alias = "scope_name")]
pub scope_name: String,
pub patterns: Vec<IRawRule>,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册