← Back to team overview

kicad-developers team mailing list archive

Re: Request in s-expression format: general user data or comment

 

On 06/23/2013 10:25 AM, Thiadmer Riemersma wrote:
> Hello Dick,
> 
>> Are you using wx as your ui?
> 
> Yes, but I am not linking to the KiCad code.
> 
>> I would accept a patch which preserves a multiline comment block thru a Load / Save ()
>> cycle if that muliline comment is first in kicad_mod file.
> 
> OK. But I will focus on the footprint manager/wizard first. It is a long way from
> finished. When that is done, I will see whether I can patch the module editor.
> 
> Thanks for pointing me to DSNLEXER. It is a bit clearer now, how the s-expressions are
> parsed and formed. One question about the quotation marks, though: apparently these can be
> changed from a double quote to either a singe quote or a dollar sign.

No, not in "non-specctrMode".  non-specctraMode equals KiCad mode within DSNLEXER.

See <kicad_src>/Documentation/s-expressions.txt

In KiCad mode (aka non-specctraMode), *only double quotes are to be used*.


Then when preparing a non-numeric string for output, we always call
OUTPUTFORMATTER::Quotes() or OUTPUTFORMATTER::Quotew(), unless it is a number, in which
case you can be certain it will not need to be quoted.  Quote{s,w} will not quote unless
quoting is needed, and will also escape any interior double quote.




 But how does that
> work? Must the new quote character indeed be prefixed by ASCII code -9? If so, is that the
> same as ASCII 247?


1) Is your code GPLv2?

If yes, then you should be using PCBIO class (in kicad_plugin.{h,cpp} and DSNLEXER and
OUTPUTFORMATTER at this point.

Otherwise your code is based on sand.

PCBIO may not be truly the opposite of sand, but as it moves you will move if you are
based on it.

In fact I will not even answer any more questions which indicate that you are not using
the foundational classes or APIs and trying to roll your own in C++.


2) madparts is ahead of KiCad itself regarding the *use of* the new "pretty" format.  I do
not know about your code, but spent some time looking at madparts.  The guy understands
the pretty format, how to store parts in a pretty directory, and fully understands that
that is our future, not the legacy format.  The moment the fp lib table is done, anyone
can switch over immediately or continue to operating using a blend of legacy, eagle,
pretty, or geda footprints, each in their own fp libraries.


I just *now* completed the ability to round trip leading (initial) comments in the
standalone pretty modules/footprints.  This does not apply to modules found in boards,
only stand alone modules, such as *.kicad_mod files either as exports or in pretty libraries.


For the madparts dude, he can probably put the entire coffee script in a comment block at
the front end of the module if he wants.  You can also now put your templating information
there also.  This was a planned feature from day one, actually not driven by you, and this
is why I did it so fast.  I meant to do it way back when.


Regards,


Dick



References