Index: [thread] [date] [author] [stats]
  From: markus schnalke <meillo@marmaro.de>
  To  : <masqmail@marmaro.de>
  Date: Sat, 18 Feb 2012 19:28:45 +0100

Config file parser: rval

Hoi,

I'm working in the src/conf.c code currently. Seems as if I'd like to
convert it into a nice recursive-descent parser, which it not truly
is.

Well, independent of that is this sentence about r-values, quoted from
masqmail.conf(5):

	If the expression is on multiple lines or contains characters
	other than  letters, digits or the characters `.', `‐', ` ',
	`/', `;', `@', `:', it must be quoted.

The code matches to the description. But I don't understand the
reasons for this limitation.

Let me explain. We have two kinds of rvals: quoted ones and not quoted
ones. If it's a quoted one, then it's easy: The value is everything
until the next (not escaped) quote. However, if it's not quoted, then
the current parser stops at symbols other than the above. But why? To
be able to put multiple statements on one line? No, as the remainder
of the line will get eaten anyways. I can't find a reason.

Does anyone of you see it?

Maybe it's just old cruft or had been a bad idea.

If there are no objections, then I'll change the code to take
everything after the equal sign as the r-value, except a possible
comment. Quotes would then only be neccessary if one would like to
assign a multiple line value. (Additionally, I'd like to make a
backslash as last character before a newline to conceal the line
break.)


Comments?


meillo


Index: [thread] [date] [author] [stats]