Crates.io | goto |
lib.rs | goto |
version | 0.1.2 |
source | src |
created_at | 2019-10-17 18:14:26.846607 |
updated_at | 2019-10-19 11:29:27.441357 |
description | A safe but not complete implementation of the goto operator. |
homepage | https://crates.io/crates/goto |
repository | https://github.com/clucompany/Goto.git |
max_upload_size | |
id | 173422 |
size | 37,630 |
A safe but not complete implementation of the goto operator.
At the moment, this is not a complete implementation of the goto operator.
We do not plan to violate Rust's safety standards. We provide useful and interesting macros that partially (or fully) implement the goto operator.
"GOTO point", allows you to return to this line later.
#[macro_use]
extern crate goto;
fn main() {
let data = b"1234567890";
let mut iter = data.iter();
let mut a;
gpoint!['begin:
a = iter.next();
match a {
a @ Some(b'0') if a == Some(&b'9') => {
println!("#a 0!");
gpoint!['add:
];
},
Some(a) => {
println!("#a {}", unsafe { std::char::from_u32_unchecked(*a as u32) });
continue 'begin;
},
_ => break 'begin,
}
];
}
Copyright 2019 #UlinProject (Denis Kotlyarov) Денис Котляров
Licensed under the MIT License
Licensed under the Apache License, Version 2.0