Macro chewing::syl

source ·
macro_rules! syl {
    () => { ... };
    ($($bopomofo:expr),+) => { ... };
}
Expand description

Builds a syllable from bopomofos.

syl! can be used in const context. It is meant for embedding const syllables or writing tests.

§Examples

Build a syllable

use chewing::zhuyin::Bopomofo::{K, U, TONE4};
use chewing::syl;

let syl = syl![K, U, TONE4];

assert_eq!("ㄎㄨˋ", syl.to_string());

§Panics

syl! can panic if the bopomofos are not well formed. For example, multiple initials or incorrect orders both cause the macro to panic.