pub fn realize_into_lookups<S>(
        &self,
        state: &ParserState,
        lookup_slices: &mut EnumMap<Layer, S>,
    ) where
        S: AsMut<[i32]>,
    {
        let mut layer_offsets: EnumMap<Layer, usize> = EnumMap::new();

        for layer in &self.input_layer_addrs.0 {
            let val = layer.get(state);
            let mut offset = &mut layer_offsets[(&layer.layer).into()];

            match layer.layer {
                addr::Layer::Char(prefix_len, suffix_len) => match val {
                    Some(chars) => {
                        for ch in chars.as_ref().chars() {
                            lookup_slices[Layer::Char].as_mut()[*offset] = lookup_char(
                                self.layer_lookups
                                    .layer_lookup(Layer::Char)
                                    .expect("Missing layer lookup for: Char"),
                                ch,
                            );

                            *offset += 1;
                        }
                    }
                    None => {
                        let null_char = self
                            .layer_lookups
                            .layer_lookup(Layer::Char)
                            .expect("Missing layer lookup for: Char")
                            .null() as i32;
                        for _ in 0..(prefix_len + suffix_len) {
                            lookup_slices[Layer::Char].as_mut()[*offset] = null_char;
                            *offset += 1;
                        }
                    }
                },
                ref layer => {
                    lookup_slices[layer.into()].as_mut()[*offset] = lookup_value(
                        self.layer_lookups
                            .layer_lookup(layer.into())
                            .expect(&format!("Missing layer lookup for: {:?}", layer)),
                        val,
                    );
                    *offset += 1;
                }
            }
        }
    }
/// Vectorize a parser state into the given lookup slices.
Vectorize a parser state into the given lookup slices.
Vectorize a parser state into the given lookup slices .
pub fn realize_into_lookups<S>(
        &self,
        state: &ParserState,
        lookup_slices: &mut EnumMap<Layer, S>,
    ) where
        S: AsMut<[i32]>,
    {
        let mut layer_offsets: EnumMap<Layer, usize> = EnumMap::new();
        for layer in &self.input_layer_addrs.0 {
            let val = layer.get(state);
            let mut offset = &mut layer_offsets[(&layer.layer).into()];
            match layer.layer {
                addr::Layer::Char(prefix_len, suffix_len) => match val {
                    Some(chars) => {
                        for ch in chars.as_ref().chars() {
                            lookup_slices[Layer::Char].as_mut()[*offset] = lookup_char(
                                self.layer_lookups
                                    .layer_lookup(Layer::Char)
                                    .expect("Missing layer lookup for: Char"),
                                ch,
                            );
                            *offset += 1;
                        }
                    }
                    None => {
                        let null_char = self
                            .layer_lookups
                            .layer_lookup(Layer::Char)
                            .expect("Missing layer lookup for: Char")
                            .null() as i32;
                        for _ in 0..(prefix_len + suffix_len) {
                            lookup_slices[Layer::Char].as_mut()[*offset] = null_char;
                            *offset += 1;
                        }
                    }
                },
                ref layer => {
                    lookup_slices[layer.into()].as_mut()[*offset] = lookup_value(
                        self.layer_lookups
                            .layer_lookup(layer.into())
                            .expect(&format!("Missing layer lookup for: {:?}", layer)),
                        val,
                    );
                    *offset += 1;
                }
            }
        }
    }
pub fn realize_into_lookups < S > ( & self , state : & ParserState , lookup_slices : & mut EnumMap < Layer , S > , ) where S : AsMut < [ i32 ] > , { let mut layer_offsets : EnumMap < Layer , usize > = EnumMap :: new ( ) ; for layer in & self . input_layer_addrs . 0 { let val = layer . get ( state ) ; let mut offset = & mut layer_offsets [ ( & layer . layer ) . into ( ) ] ; match layer . layer { addr :: Layer :: Char ( prefix_len , suffix_len ) => match val { Some ( chars ) => { for ch in chars . as_ref ( ) . chars ( ) { lookup_slices [ Layer :: Char ] . as_mut ( ) [ * offset ] = lookup_char ( self . layer_lookups . layer_lookup ( Layer :: Char ) . expect ( " " ) , ch , ) ; * offset += 1 ; } } None => { let null_char = self . layer_lookups . layer_lookup ( Layer :: Char ) . expect ( " " ) . null ( ) as i32 ; for _ in 0 .. ( prefix_len + suffix_len ) { lookup_slices [ Layer :: Char ] . as_mut ( ) [ * offset ] = null_char ; * offset += 1 ; } } } , ref layer => { lookup_slices [ layer . into ( ) ] . as_mut ( ) [ * offset ] = lookup_value ( self . layer_lookups . layer_lookup ( layer . into ( ) ) . expect ( & format ! ( " " layer ) ) , val , ) ; * offset += 1 ; } } } }
Vectorize a parser state into the given lookup slices.
Vectorize a parser state into the given lookup slices .
&self
state
&ParserState
lookup_slices
&mut EnumMap<Layer, S>
&self
state
&ParserState
lookup_slices
&mut EnumMap<Layer, S>