Re: REWRITE: Parsing

2014-08-26 Thread Dominik Vogt
I've pushed an attempt to define character classes, single character quoting, unqouted and quoted strings, STRING and TOKEN. Note that we need to go over the actual uses of STRING to see whether they should be using something else. That's an interesting point -- consider *any*

Re: REWRITE: Parsing

2014-08-26 Thread Thomas Adam
On Tue, Aug 26, 2014 at 08:39:57AM +0200, Dominik Vogt wrote: You are right. The current code mixes all sorts of things in an order that lacks proper definition: * Reading command lines from various sources (module input, file input, PipeRead), including parsing of continued lines.

Re: REWRITE: Parsing

2014-08-26 Thread Thomas Adam
On Tue, Aug 26, 2014 at 10:33:39AM +0200, Dominik Vogt wrote: It looks incorrect to me, as in I would have expected: MENUCONTEXT =/ Window / Interior MENUCONTEXT =/ Title Yes. Note that the first line just has =, not =/. That was also broken. Both now fixed. Cheers, --

Re: REWRITE: Parsing

2014-08-26 Thread Dominik Vogt
Another example are function definitions: AddToFunc TeddyBear I Echo xteddy AddToFunc TeddyBear + C Exec exec xteddy + M Nop This is actually a terrible piece of the fvwm syntax: Function and menu definitions are not atomic. If you write a function definition using

Historical Parsing (twm onwards) [WAS: Re: REWRITE: Parsing]

2014-08-26 Thread Thomas Adam
On Tue, Aug 26, 2014 at 07:32:17PM +0100, Dominik Vogt wrote: Another example are function definitions: AddToFunc TeddyBear I Echo xteddy AddToFunc TeddyBear + C Exec exec xteddy + M Nop This is actually a terrible piece of the fvwm syntax: Function and menu

Re: Historical Parsing (twm onwards) [WAS: Re: REWRITE: Parsing]

2014-08-26 Thread Dan Espen
Thomas Adam tho...@fvwm.org writes: On Tue, Aug 26, 2014 at 07:32:17PM +0100, Dominik Vogt wrote: Another example are function definitions: AddToFunc TeddyBear I Echo xteddy AddToFunc TeddyBear + C Exec exec xteddy + M Nop This is actually a terrible piece

Re: Historical Parsing (twm onwards) [WAS: Re: REWRITE: Parsing]

2014-08-26 Thread Dominik Vogt
On Tue, Aug 26, 2014 at 03:20:09PM -0400, Dan Espen wrote: Thomas Adam tho...@fvwm.org writes: I might take the blame for other mis-designed things, but as far as I remember, that goes way back. I think the issue was those pretty long commands AddToFunc, etc. But the + sign is just broken.

REWRITE: New parser design

2014-08-26 Thread Dominik Vogt
Pondering a new parser a bit, I think it would be good to split the existing command implementations: 1. A user interface function that takes the F_CMD_ARGS argument list as it does now. Its tasks are: a) To prepare a structure that contains the syntax tables for the command and any

Re: REWRITE: New parser design

2014-08-26 Thread Thomas Adam
On Tue, Aug 26, 2014 at 10:42:03PM +0100, Dominik Vogt wrote: 1. A user interface function that takes the F_CMD_ARGS argument list as it does now. Its tasks are: a) To prepare a structure that contains the syntax tables for the command and any context information that is

Re: REWRITE: New parser design

2014-08-26 Thread Dan Espen
Thomas Adam tho...@fvwm.org writes: * Tokenisation in the form key/value means that each command can lookup the data in the same way. For instance: if (has_token(level)) { int l = strtonum(get_token(level), 1, INT_MAX, NULL); if (l 10)