2024-01-25 15:05:32 +00:00
|
|
|
use fmt;
|
|
|
|
use os;
|
|
|
|
use strings;
|
|
|
|
use unicode;
|
|
|
|
|
|
|
|
export fn main() void = {
|
|
|
|
const in = os::args[1];
|
|
|
|
const iter = strings::iter(in);
|
2024-04-16 11:17:50 +00:00
|
|
|
|
2024-01-25 15:05:32 +00:00
|
|
|
for (true) {
|
|
|
|
const rn = match (strings::next(&iter)) {
|
|
|
|
case let rn: rune =>
|
|
|
|
yield rn;
|
|
|
|
case => break;
|
|
|
|
};
|
|
|
|
const gc = unicode::rune_gc(rn);
|
2024-01-26 10:16:11 +00:00
|
|
|
const sc = unicode::rune_script(rn);
|
2024-04-16 11:17:50 +00:00
|
|
|
const lb = unicode::rune_line_break(rn);
|
|
|
|
fmt::printfln("'{}'/{:x}: {} : {} : {}",
|
2024-01-26 10:16:11 +00:00
|
|
|
rn, rn: u32,
|
|
|
|
unicode::gc_code(gc),
|
2024-04-16 11:17:50 +00:00
|
|
|
unicode::script_code(sc),
|
|
|
|
unicode::line_break_code(lb))!;
|
2024-01-25 15:05:32 +00:00
|
|
|
};
|
|
|
|
};
|