libconf-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libconf-dev] Re: shell template and whitespace around the =


From: dams
Subject: [Libconf-dev] Re: shell template and whitespace around the =
Date: Sat, 14 Jun 2003 16:05:15 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

"Brian J. Murrell" <address@hidden> said:

> On Sat, 2003-06-14 at 08:33, address@hidden wrote:
>> 
>> If you want, you can lurk on #libconf on freenodes.net irc, there is someone
>> sometimes...
>
> I'm not much of an IRC person actually.  It's just too synchronous and
> as such requires too much (human) interrupt processing.  It's too much
> like the telephone.  Requires you to participate real-time.

That's right :) mail is good

>
> I am just looking over the source currently.
>
> Something I noticed is that the "shell" template (for parsing
> "key=value" type config files, right?) does not allow for whitespace
> before and/or after the = sign.  Perhaps the RE:
>
> "s/^\s*(\w+)\s*=\s*("([^"]*)"|'([^']*)'|[^'"\s]+)\s*$//
>
> would be more robust?

What is missing is an exact explanation of what do the templates accept as
valid and what they don't. I'll try to write it in the headers of the
templates.

So, the initial rules I decided for the shell template was to stick with the
shell behaviour. As far as I know, var = value is not valid in shell, so in my
opinion, the template should not recognize it as valid atom.

That's why I planed to do a 'keyvalue' template, less restrictive, more robust,
based on the shell template, with minor modifications (your regexp is one of
them). In the initial libconf version, there was such a template, but because
we rewrote the templates entirely, we forgot this keyvalue template. I'll add
it this afternoon.

-- 
dams




reply via email to

[Prev in Thread] Current Thread [Next in Thread]