Consider the following code:
#[derive(Nom)]
#[nom(LittleEndian, Selector = "FileType")]
pub enum FileBody {
#[nom(Selector = "FileType::DIR")]
Dir(DirEntry),
#[nom(Selector = "FileType::FILE | FileType::BYTES")]
File(FileEntry),
}
This fails with the following error message:
proc-macro derive panicked
message: Parsing the 'nom' meta attribute failed: Error("unexpected token")
Stacking selector attributes results in runtime parsing errors:
#[derive(Nom)]
#[nom(LittleEndian, Selector = "FileType")]
pub enum FileBody {
#[nom(Selector = "FileType::DIR")]
Dir(DirEntry),
#[nom(Selector = "FileType::FILE")]
#[nom(Selector = "FileType::BYTES")]
File(FileEntry),
}
Or:
#[derive(Nom)]
#[nom(LittleEndian, Selector = "FileType")]
pub enum FileBody {
#[nom(Selector = "FileType::DIR")]
Dir(DirEntry),
#[nom(Selector = "FileType::FILE", Selector = "FileType::BYTES")]
File(FileEntry),
}
Consider the following code:
This fails with the following error message:
Stacking selector attributes results in runtime parsing errors:
Or: