summaryrefslogtreecommitdiff
path: root/lib/std/hassuffix.myr
blob: 87369afdb02c67ae5a3381b0892f81f3ba6fa643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use "sleq.use"
pkg std =
	const hassuffix	: (s : byte[:], suff : byte[:] -> bool)
;;

const hassuffix = {s, suff
	var tail

	if suff.len <= s.len
		tail = s[s.len - suff.len:]
		-> sleq(tail, suff)
	;;
	-> false
}