add demo text; made executable for the demo
This commit is contained in:
parent
ba3b003792
commit
e49a1794e6
18
resources/test/example_1.sil
Normal file
18
resources/test/example_1.sil
Normal 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.|)
|
||||
)
|
||||
)
|
||||
)
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user