PistonDevelopers / meta

A DSL parsing library for human readable text documents
MIT License
90 stars 5 forks source link

Add struct `Convert` for converting meta data #299

Closed bvssvni closed 8 years ago

bvssvni commented 8 years ago

Currently there are a bunch of methods taking &[Range<MetaData>], offset: usize. This could be put in a struct Convert to encapsulate the state. Could use same pattern as in the read_token library.

pub struct Convert<'a> {
    data: &'a [Range<MetaData>],
    offset: usize,
}

Move functions to methods on Convert:

Use Convert internally in convert: