~torresjrjr/dc

3ed4fa80d02aa05a0e571cf8ed26652dbb99909c — Byron Torres 2 years ago da8980f
update "case let" syntax
1 files changed, 7 insertions(+), 7 deletions(-)

M dc.ha
M dc.ha => dc.ha +7 -7
@@ 34,9 34,9 @@ export fn main() void = {
		};

		const file = match (os::open(filename)) {
		case f: io::file =>
		case let f: io::file =>
			yield f;
		case err: fs::error =>
		case let err: fs::error =>
			fmt::fatal("dc: {} '{}'", fs::strerror(err), filename);
		};
		defer io::close(file);


@@ 57,7 57,7 @@ fn dc(in: io::handle) void = {
			fmt::fatal("dc: IO error");
		case io::EOF =>
			break;
		case r: rune =>
		case let r: rune =>
			yield r;
		};



@@ 87,12 87,12 @@ fn dc(in: io::handle) void = {
			case io::EOF =>
				fmt::errorln("dc: no shell command given")?;
				continue;
			case input: []u8 =>
			case let input: []u8 =>
				yield match (strings::try_fromutf8(input)) {
				case utf8::invalid =>
					fmt::errorln("dc: invalid shell command input")?;
					continue;
				case c: str =>
				case let c: str =>
					yield c;
				};
			};


@@ 239,7 239,7 @@ fn scan_number(in: io::handle) f64 = {
			fmt::fatal("dc: IO error");
		case io::EOF =>
			yield ' ';
		case r: rune =>
		case let r: rune =>
			yield r;
		};
		if (ascii::isdigit(r) || (!seen_decimal && r == '.')) {


@@ 252,7 252,7 @@ fn scan_number(in: io::handle) f64 = {
			match (strconv::stof64(strings::fromutf8(num))) {
			case (strconv::invalid | strconv::overflow) =>
				abort("dc: invalid numerical input");
			case n: f64 =>
			case let n: f64 =>
				return n;
			};
		};