goto

Crates.iogoto
lib.rsgoto
version0.1.2
sourcesrc
created_at2019-10-17 18:14:26.846607
updated_at2019-10-19 11:29:27.441357
descriptionA safe but not complete implementation of the goto operator.
homepagehttps://crates.io/crates/goto
repositoryhttps://github.com/clucompany/Goto.git
max_upload_size
id173422
size37,630
Denis Kotlyarov (denisandroid)

documentation

README

Goto

A safe but not complete implementation of the goto operator.

Build Status Mit/Apache licensed crates.io Documentation

Attention!!

  1. At the moment, this is not a complete implementation of the goto operator.

  2. We do not plan to violate Rust's safety standards. We provide useful and interesting macros that partially (or fully) implement the goto operator.

gpoint:

"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,
		}
		
	];
}

License

Copyright 2019 #UlinProject (Denis Kotlyarov) Денис Котляров

Licensed under the MIT License

Licensed under the Apache License, Version 2.0

Commit count: 22

cargo fmt