shithub: mc

ref: 8c0eb9f56edefcc15a206f8e165056803f9f5b99
dir: /types.myr/

View raw version
use std

pkg regex =
	type regex = struct
		prog	: reinst[:]
		nthr	: std.size
		thr	: rethread#[:]
		str	: byte[:]
		strp	: std.size
		matched	: std.option(rethread#)
	;;

	type rethread = struct
		uid	: std.size
		ip	: std.size
	;;

	type reinst = union
		/* direct consumers */
		`Byte	byte
		`Range	[byte, byte]
		`Dot

		`Match	/* found the end of the expr */

		`Split	[std.size, std.size]
		`Jmp	std.size
	;;
;;