wip: rethinking stack machine

This commit is contained in:
Jonathan Kelley committed 2021-06-19 20:31:25 -04:00
1 parent 70cd46dbb2
commit 62ae5d3bb9
7 files changed
+229 -86

No files matched your search

+3 -8
View File
@@ -50,14 +50,9 @@ impl Parse for AmbiguousElement {
false => {
let first_char = name_str.chars().next().unwrap();
if first_char.is_ascii_uppercase() {
match name_str.as_str() {
"Fragment" => input
.parse::<Fragment>()
.map(|c| AmbiguousElement::Fragment(c)),
_ => input
.parse::<Component>()
.map(|c| AmbiguousElement::Component(c)),
}
input
.parse::<Component>()
.map(|c| AmbiguousElement::Component(c))
} else {
let name = input.parse::<Ident>().unwrap();
Err(Error::new(
+13 -27
View File
@@ -34,30 +34,16 @@ pub fn fc_to_builder<T: Properties>(_: FC<T>) -> T::Builder {
T::builder()
}
mod eliminate_bounds {
struct BNode<'a> {
_p: &'a (),
}
trait Broper {}
impl Broper for () {}
struct Bontext<'a, P: Broper + 'a> {
inner: &'a (),
props: P,
}
fn Bexample(c: Bontext<()>) -> BNode {
todo!()
}
struct MyBrops<'a> {
_i: &'a (),
}
impl<'a> Broper for MyBrops<'a> {}
fn Bexample2<'a>(c: Bontext<'a, MyBrops<'a>>) -> BNode {
todo!()
}
}
/// Create inline fragments
/// --
///
/// Fragments capture a series of children without rendering extra nodes.
///
///
///
pub static Fragment: FC<()> = |ctx| {
use crate::prelude::*;
ctx.render(LazyNodes::new(move |c| {
crate::nodebuilder::vfragment(c, None, ctx.children())
}))
};
+1 -1
View File
@@ -50,7 +50,7 @@ pub(crate) mod innerlude {
/// Re-export common types for ease of development use.
/// Essential when working with the html! macro
pub mod prelude {
pub use crate::component::{fc_to_builder, Properties};
pub use crate::component::{fc_to_builder, Fragment, Properties};
use crate::nodes;
pub use crate::virtual_dom::Context;
pub use crate::virtual_dom::Scoped;