moonrockz/gleam-parser/config does not have a README file
test {
let c = @config.Config::default()
debug_inspect(c.fuel, content="Unlimited")
inspect(c.dialect.name, content="gleam-1.19")
}test {
let p = @config.Config::from_toml("[parser]\nfuel = 550\n")
debug_inspect(
p.fuel.bind(limit => limit.budget()).map(b => b.units()),
content="Some(550)",
)
inspect(p.dialect is None, content="true")
}fn parse_with_config(text : String) -> @gleam.ParseResult raise {
let config = @gleam.Config::load()
@gleam.parse_text(text, config~)
}pub struct Environment((String) -> String?)test {
let file : @config.Partial = {
dialect: None,
fuel: @fuel.Budget::from_int(500).map(b => Limited(b)),
}
let env : @config.Partial = {
dialect: None,
fuel: @fuel.Budget::from_int(2000).map(b => Limited(b)),
}
let c = env.with_fallback(file).to_config(@config.Config::default())
debug_inspect(c.fuel.budget().map(b => b.units()), content="Some(2000)")
}Install
Download zipParser and parsing utilities for the Gleam programming language in MoonBit