test multiline parsing
This commit is contained in:
parent
e67f84a4ce
commit
1f55bb8c31
1 changed files with 7 additions and 4 deletions
11
src/main.rs
11
src/main.rs
|
@ -15,7 +15,7 @@ fn main() {
|
|||
let lock = Arc::new(RwLock::new([p; LED_SIZE]));
|
||||
let mut pattern: Vec<Box<dyn Pattern>> = Vec::new();
|
||||
let read = Arc::clone(&lock);
|
||||
/// light management
|
||||
//light management
|
||||
thread::spawn(move || {
|
||||
let mut controller: Controller = ControllerBuilder::new()
|
||||
.channel(0, ChannelBuilder::new()
|
||||
|
@ -33,8 +33,11 @@ fn main() {
|
|||
}
|
||||
});
|
||||
|
||||
/// pattern parsing
|
||||
let mul_string = format_multiline("unit");
|
||||
//pattern parsing
|
||||
let mul_string = format_multiline(concat!(
|
||||
"val 0 0 255",
|
||||
"val r 255"
|
||||
));
|
||||
let res: Result<Vec<Box<dyn Pattern>>, ParseError> = mul_string.iter()
|
||||
.map(|x: &Vec<String>| parse_line((*x).clone()))
|
||||
.collect();
|
||||
|
@ -42,7 +45,7 @@ fn main() {
|
|||
pattern = res.unwrap();
|
||||
}
|
||||
|
||||
/// pattern management
|
||||
//pattern management
|
||||
loop {
|
||||
thread::sleep(time::Duration::from_millis(LOOP_WAIT));
|
||||
for p in &pattern {
|
||||
|
|
Loading…
Reference in a new issue