← Back to team overview

kicad-developers team mailing list archive

Re: We should decide a quoting convention...


--- In kicad-devel@xxxxxxxxxxxxxxx, Dick Hollenbeck <dick@...> wrote:
> We will keep it simple, and I admit that there are a couple minor holes 
> in the lisp-like format that we need to plug.
> In general however, my thinking is this:
> Any such file is to be interpreted as a blend of ASCII sequences with 
> intermittent UTF8 sequences. The ASCII sequences are the keywords, '(', 
> and ')' delimiters, everything except a quoted string is ASCII.
> The UTF8 sequences are reserved ONLY for quoted strings.

Why not everywhere?

> Quoted strings are required for ONLY for tokens which must include 
> either a) one of the ASCII white space characters, or b) a non ASCII 
> character, or c) ')' or '('.

Why not just escape white spaces and parentheses (by \x20 or %20)? Also UTF-8 multibyte sequences do not interfere with any control characters, so no need to enclose them.

> Within a quoted string, it is assumed to be UTF8, no exceptions, and 
> therefore inherently supports all international 16 bit characters.
Unicode is 21 bit, do not forget this.

> With this understanding the problem is reduced to quoted strings, and
> A) differentiating the leading and trailing quote from a quote character 
> within the quoted string, and

Escape quotes to some sequence which do not contain quote. Or just do not use quotes.

> B) as aid for human readability, some consideration might be given to 
> the handling of new lines, so that they do not screw up the pretty 
> indenting that these files typically have.

Do you think that human readability is not enough? Do anybody need this?

Much better if format is easily parsed, so it wouldn't be a problem writingconverters and such.

Follow ups