Permalink
Browse files

Add Niecza::UCD minimalist access module

  • Loading branch information...
sorear committed Dec 19, 2011
1 parent 60d6d0d commit 808b2c168a2f5c935a38a981a8592d678c15a9e2
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/Niecza/UCD.pm6
View
@@ -0,0 +1,20 @@
module Niecza::UCD;
sub ranges_num($table, $matcher) is export {
Q:CgOp { (ucd_get_ranges {$table} {$matcher}) }
}
sub get_value_num($table, $ord) is export {
Q:CgOp { (ucd_get_value {$table} {$ord}) }
}
sub ranges($table, $matcher) is export {
my @ranges;
for ranges_num($table, $matcher) -> $low, $limit {
push @ranges, ($limit == $low + 1) ?? chr($low) !!
$(chr($low) .. chr($limit-1));
}
@ranges
}
sub value($table, $chr) is export { get_value_num($table, ord $chr) }

0 comments on commit 808b2c1

Please sign in to comment.