Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset
Home

[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx (Freeciv developers)
Subject: [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification)
From: Reinier Post <rp@xxxxxxxxxx>
Date: Tue, 2 Oct 2001 13:38:10 +0200

On Mon, Oct 01, 2001 at 08:40:26PM -0400, Ross W. Wetmore wrote:
> Is it not easier to pick one character as an escape character like "\", 
> to actually treat the escape character as a character it escapes itself. 

I don't think it's easier or harder to parse and I don't know whether
or not it is easier for the user.  Unix shell users will understand it
right away and they may even try it without checking whether it is
actually implemented (just like the IRC commands you frequently see.)
That is a good reason to support it I suppose.

> Then you parse the line without any need to understand context, just 
> that "escaped" characters are always just "characters" with no special
> meaning.

It's a 1-byte context :)  The other proposal requires a 1-bit memory
to store the context.

> If you set a flag to NOT remove escapes you can process the line many
> times. Presumably the last pass would remove the escapes.

Is this necessary?

> The escaping rule, being general works,

Yes.

> for a any other case you might 
> need without adding more and more special context heruistics. For example
> you could put spaces or commas in strings without even needing to quote.

So you have two systems (quoting and escaping) where one would suffice.
Perhaps this is what I don't like about it.

> At 10:12 PM 01/10/01 +0200, Reinier Post wrote:
> >Yes, but I presented a system for quoting that would be easy to parse:
> >quote by surrounding with " ", and make ""  stand for " within " "s.
> >You do have to keep track of whether you're within quotes or not.
> >It can be made obligatory to quote names.
> [...]
> >-- 
> >Reinier
> 
> Cheers,
> RossW
> =====

-- 
Reinier


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