goto 0.1.2

A safe but not complete implementation of the goto operator.
Documentation
  • Coverage
  • 40%
    2 out of 5 items documented1 out of 1 items with examples
  • Size
  • Source code size: 37.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 709 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • clucompany/Goto
    6 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • denisandroid

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