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: Reinier Post <rp@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx (Freeciv developers)
Subject: [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Mon, 01 Oct 2001 20:40:26 -0400

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. 

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

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

With this rule, you just need to count ", odd you are in, even you are
out, because escaped quotes are just normal characters.

The escaping rule, being general works, 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.

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
=====




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