#[macro_use]
extern crate lut;
#[macro_use]
extern crate lazy_static;
#[test]
fn compile_only_tests() {
}
new_table! {
flags { E11=E1, E12=E2, E13=E3, E14=E4 }
struct TableToCheckMacroExpansioWithMoreThanOneOrTwoElements {
static data: [u8; 4] = [
E1, E3, E2, E4
];
}
}
new_table! {
pub flags { A11=A1, A12=A2 }
pub struct Tab1 {
static data: [u8; 4] = [
A1, A1|A2, -, -
];
}
}
new_table! {
flags { A21=X }
struct Tab2 {
static data: [u8; 4] = [
X, -, X, -
];
}
}
merge_tables! {
struct Tab12 {
static data: [u8;4]
= Tab1 { A11, A12 }
+ Tab2 { A21 };
}
}
accessor_all!{ A11AndA12 = A11 & A12 }
accessor_any!{ A11OrA21 = A11 | A21 }
mod compile_pub_flags_priv_table {
new_table! {
pub flags { F1=F1, F2=F2 }
struct Table {
static data: [u8; 3] = [
F1, F1|F2, F2
];
}
}
}
mod compile_priv_flags_pub_table {
new_table! {
flags { F1=F1, F2=F2 }
pub struct Table {
static data: [u8; 3] = [
F1, F1|F2, F2
];
}
}
}
mod compile_pubcrate_both {
new_table! {
pub(crate) flags { F1=F1, F2=F2 }
pub(crate) struct Table {
static data: [u8; 3] = [
F1, F1|F2, F2
];
}
}
}
mod compile_relative_path_merge {
use super::{A11, A12};
use super::compile_pubcrate_both::{F1, F2};
merge_tables! {
struct Table {
static data: [u8; 4]
= super::Tab1 { A11, A12 }
+ super::compile_pubcrate_both::Table { F1, F2 };
}
}
merge_tables! {
pub struct TableX {
static data: [u8; 4]
= super::Tab1 { A11, A12 };
}
}
merge_tables! {
pub(crate) struct TableQ {
static data: [u8; 4]
= super::Tab1 { A11, A12 };
}
}
}
mod with_attributes {
new_table! {
flags {
Index0=X,
Index1=Y
}
struct Table {
static data: [u8; 2] = [ X, Y ];
}
}
merge_tables! {
struct Table2 {
static data: [u8; 2] = Table { Index0 };
}
}
}
mod handling_of_unexpected_cases {
new_table! {
flags {}
struct Table1 {
static data: [u8; 2] = [-,-];
}
}
mod unused_flag {
#![allow(dead_code)]
new_table! {
flags { F1=F1 }
struct Table3 {
static data: [u8; 1] = [ - ];
}
}
}
}