1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
use crate as whasm;
use self::whasm::grammar::{ *, section::* };

#[derive(Debug, PartialEq, Grammar)]
pub struct Module {
    #[matching(magic if magic == ['\0', 'a', 's', 'm'])]
    pub magic: [Byte; 4],

    #[matching(ver if ver == [1, 0, 0, 0])]
    pub version: [Byte; 4],

    pub sections: List<Section>,
}