[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reading a conf file
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Wed, 28 Sep 2016 17:44:43 +0100
2016-09-28 6:51 GMT+01:00 Sean Conner <sean@conman.org>:
> You already have a parser available to you---Lua. If the config file is
> just what you said:
>
> a=series
> of=key
> value=pairs
>
> A small change:
You don't need to change the syntax to use the Lua parser for that.
With a metatable on the _ENV, you can have global variable reads
(__index) return the variable name, so that series is the same as
"series". This only works with valid Lua variable names, but that
covers a lot of ground and you can fall back to quotes for the rest.