use crate::tokens_cfg::{ ConfigToken, ConfigLine, Value }; use crate::tokens_cpp::{ LexicalError, }; grammar; extern { type Location = usize; type Error = LexicalError; enum ConfigToken { "string lit" => ConfigToken::StringLiteral(), "ident" => ConfigToken::Identifier(), "int" => ConfigToken::Integer(), "ip" => ConfigToken::IP(), "endline" => ConfigToken::Endline, } } pub Configs: Vec = { => entries } Value: Value = { => Value::String(x), => Value::Int(x), => Value::Key(x), => Value::IP(x), } Entry: ConfigLine = { "endline" => { ConfigLine { name, values } } }