diff options
| author | Mica White <botahamec@outlook.com> | 2026-10-03 14:14:31 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-10-03 14:14:31 -0400 |
| commit | 1b7ddd5894c2636618e630f44b1bb7d598d29b48 (patch) | |
| tree | 23634f9a1e95a719628b5978c834d1c7de69e615 /src/analyze.rs | |
| parent | 67083043f5da93c447468578c49ffec1a679f1cc (diff) | |
Planning for 0.2
Diffstat (limited to 'src/analyze.rs')
| -rw-r--r-- | src/analyze.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/analyze.rs b/src/analyze.rs index b8a7012..6526c2b 100644 --- a/src/analyze.rs +++ b/src/analyze.rs @@ -58,6 +58,10 @@ pub struct HeadSymbol<'a> { #[derive(Debug)] pub enum ConstantType<'a> { String, + Fragment { + direct_children_tags: Option<&'a [&'a str]>, + transitive_children_tags: Option<&'a [&'a str]>, + }, Block { direct_children_tags: Option<&'a [&'a str]>, transitive_children_tags: Option<&'a [&'a str]>, @@ -65,14 +69,14 @@ pub enum ConstantType<'a> { } #[derive(Debug)] -pub enum ConstantValue<'a> { +pub enum ConstantLiteral<'a> { String(&'a str), } #[derive(Debug)] pub enum ConstantExpression<'a> { Name(&'a str), - Value(ConstantValue<'a>), + Value(ConstantLiteral<'a>), Fragment(&'a [ConstantSymbolId]), Block { tag_name_lowercase: &'a str, @@ -104,7 +108,7 @@ fn element_attributes<'a>( id, name: None, ty: Some(ConstantType::String), - value: Some(ConstantExpression::Value(ConstantValue::String(value))), + value: Some(ConstantExpression::Value(ConstantLiteral::String(value))), definition_site: None, }, ); @@ -146,7 +150,7 @@ fn node_to_constant<'a>( id, name: None, ty: Some(ConstantType::String), - value: Some(ConstantExpression::Value(ConstantValue::String(value))), + value: Some(ConstantExpression::Value(ConstantLiteral::String(value))), definition_site: None, }, ); @@ -164,7 +168,7 @@ fn node_to_constant<'a>( ConstantSymbol { id, name: None, - // TODO fragment type + // TODO acquire the type ty: None, value: Some(fragment), definition_site: None, @@ -259,7 +263,7 @@ fn add_constant<'a>(symbol_table: &mut ScopedSymbolTable<'a>, element: &'a Eleme id, name, ty: Some(ConstantType::String), - value: value.map(|value| ConstantExpression::Value(ConstantValue::String(value))), + value: value.map(|value| ConstantExpression::Value(ConstantLiteral::String(value))), definition_site: Some(*element), }, ); |
