add demo text; made executable for the demo

This commit is contained in:
Keisuke Hirata 2024-12-09 04:58:26 +09:00
parent ba3b003792
commit e49a1794e6
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,18 @@
(container []
(header []
(title [] |Demo #1|)
)
(main []
(std<Image> [alt="hoge" ref="./upload/hoge.jpg"])
(section [lang=md ] |\
# Hello, world!\
This is a simple example of SIL.\
|)
)
(footer []
(card []
(icon<Image> [src="/icon.png" alt="Cute icon" on:click="alert('Hello!')"])
(copyright [] |Copyright here.|)
)
)
)

View File

@ -164,7 +164,9 @@ impl Iterator for Tokenizer {
return self.latest.take();
}
x => {
if !x.is_ascii_alphanumeric() && x != '=' && x != ':' {
if !x.is_ascii_alphanumeric()
&& !vec!['=', ':', '"', '\'', '.', '/', '(', ')', '!'].contains(&x)
{
panic!("Unexpected character: {}", x);
}
self.buffer.push(x);
@ -210,6 +212,11 @@ impl Iterator for Tokenizer {
}
}
},
State::InQuote => match c {
'"' => todo!(),
_ => todo!(),
},
State::InDoubleQuote => todo!(),
}
}
}
@ -224,6 +231,9 @@ enum State {
AfterDefine,
Behavior,
BehaviorSeparator,
InQuote,
InDoubleQuote,
}
#[derive(Debug, Clone, PartialEq, Eq)]