mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-28 21:06:56 +02:00
This commit is contained in:
parent
20517f09b4
commit
a9f2fa2cdd
17 changed files with 655 additions and 491 deletions
|
|
@ -45,16 +45,20 @@ impl_keywords!(Tui, XYWH<u16>, State [
|
|||
kw_tui_bg
|
||||
]);
|
||||
|
||||
impl Interpret<Tui, Option<XYWH<u16>>> for State {
|
||||
fn interpret_word (&self, to: &mut Tui, sym: &impl Language) -> Perhaps<XYWH<u16>> {
|
||||
match sym.src()? {
|
||||
impl<'a> Interpret<'a, Tui, Option<XYWH<u16>>> for State {
|
||||
fn interpret_word <L: Language<'a> + ?Sized> (&'a self, to: &mut Tui, lang: &'a L)
|
||||
-> Drawn<'a, u16>
|
||||
{
|
||||
match lang.src()? {
|
||||
Some(":foo") => "foo".draw(to),
|
||||
Some(":bar") => "bar".draw(to),
|
||||
Some(":foobar") => "FOOBAR".draw(to),
|
||||
src => todo!("src: {src:?}")
|
||||
}
|
||||
}
|
||||
fn interpret_expr (&self, to: &mut Tui, src: &impl Expression) -> Perhaps<XYWH<u16>> {
|
||||
fn interpret_expr <L: Language<'a> + ?Sized> (&self, to: &mut Tui, src: &'a L)
|
||||
-> Drawn<'a, u16>
|
||||
{
|
||||
if let Some(area) = self.keyword(to, src)? {
|
||||
Ok(Some(area))
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue