Add new syntax extension fourcc!()

fourcc!() allows you to embed FourCC (or OSType) values that are
evaluated as u32 literals. It takes a 4-byte ASCII string and produces
the u32 resulting in interpreting those 4 bytes as a u32, using either
the platform-native endianness, or explicitly as big or little endian.
This commit is contained in:
Kevin Ballard
2013-09-16 19:30:28 -07:00
committed by Derek Guenther
parent b66ec3483b
commit c1cc7e5f16
9 changed files with 206 additions and 0 deletions

View File

@@ -194,6 +194,9 @@ pub fn syntax_expander_table() -> SyntaxEnv {
syntax_expanders.insert(intern("bytes"),
builtin_normal_expander(
ext::bytes::expand_syntax_ext));
syntax_expanders.insert(intern("fourcc"),
builtin_normal_tt_no_ctxt(
ext::fourcc::expand_syntax_ext));
syntax_expanders.insert(intern("concat_idents"),
builtin_normal_expander(
ext::concat_idents::expand_syntax_ext));