69 Commits

Author SHA1 Message Date
Jeff Young
89fcd3134e ADDED: text variable processing in DRC rules.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11231
2025-06-23 09:02:51 -06:00
Jeff Young
70dfc9215d Accept empty "(fp)" statements.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20002
2025-06-08 16:33:05 +01:00
Jeff Young
adb535e649 Initializer safety. 2025-06-05 18:01:44 +01:00
Seth Hillbrand
dd92736c46 Handle unquoted strings that use the bar '|' character
We use this as part of the standard sexpr now.  But previously, if a
designer used the '|' character as part of a string with no spaces, it
would be entered unquoted into the file, which neccesitates special
handling

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21065

(cherry picked from commit 5eacca8b18324422334180a38bd1c1adc62e20d6)
2025-06-04 10:54:22 -07:00
Jeff Young
eb4a52f372 Remove debugging code accidentally left in. 2025-03-19 17:44:17 +00:00
Jeff Young
7e046e6c8b Remove '~' == empty_string.
It has long outlived its usefulness (which was
to preserve token sequence in pre-sexpr files).

This will no doubt turn up latent issues....
2025-03-19 17:16:55 +00:00
Wayne Stambaugh
af540bbb9a Header folder housekeeping. 2025-01-09 07:44:11 -05:00
Wayne Stambaugh
f74d97d2e1 Revert "Header folder housekeeping."
This reverts commit d1898aab47d9e4fc95b02f399fb95108e6b937b4.
2025-01-08 12:27:15 -05:00
Wayne Stambaugh
d1898aab47 Header folder housekeeping. 2025-01-08 11:38:44 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6918

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2376

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Marek Roszko
f8744b7797 dsnlexer can live in kicommon 2024-01-03 23:18:31 -05:00
qu1ck
a6d10c8e97 Enable warnings on msvc 2023-04-11 00:17:50 +00:00
Marek Roszko
425edf3a7e Revert "Simplify the generated lexers to the use of a templated class"
This reverts commit 6eb6447708f4b31fc273cf6d516aeffc3576cde5.
2022-08-21 18:45:09 -04:00
Marek Roszko
6eb6447708 Simplify the generated lexers to the use of a templated class 2022-08-21 18:23:28 -04:00
Marek Roszko
c418b25756 Centralize the parseDouble functions in the parsers and gcc specialcase 2022-08-14 18:46:19 -04:00
Marek Roszko
f695ae5522 Generate const keyword_hash maps at compile time
Or else the map gets pointlessly recreated during footprint loading thousands of times
2022-08-09 00:56:49 -04:00
jean-pierre charras
ee5f9034f7 pcb parser: ensure the parser is reinitialized before parsing a new fp file
Because the same parser is used to read all footprint files of a library,
the parser must be reinitialized (internal variable cleared) before reading
a new file, otherwise the previous parser state is applied to the next file.
Fixes #7627
https://gitlab.com/kicad/code/kicad/issues/7627
2021-08-26 19:38:20 +02:00
Wayne Stambaugh
bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Wayne Stambaugh
bf00ebee3b Header clean up round 1. 2020-12-18 09:04:26 -05:00
Werni
0e44f5128c Add const specifiers 2020-11-18 19:50:36 +00:00
Jeff Young
f244f3b24c Last issue wasn't gcc/CLang after all, but the lexer not getting built. 2020-08-06 23:16:58 +01:00
Jeff Young
af6bd76dce Fix for gcc. 2020-08-06 22:42:26 +01:00
Jeff Young
f27661fa39 Be more flexible with user input; more multibyte safety. 2020-08-06 19:38:06 +01:00
Seth Hillbrand
7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Seth Hillbrand
4d2e953f42 Cleanup: Replace C-only deprecated headers
This replaces headers deprecated by C++14 with their equivalent
replacement
2019-12-05 11:03:15 -08:00
Carsten Schoenert
a11714b1a4 fix misspelled 'an other' -> 'another' 2018-04-08 13:24:37 -04:00
Jeff Young
b8fd2f3c79 Revert "Don't be pedantic about the file format."
This reverts commit 1537cbc59c3cece4c69632c11a5418681a328e27.
2018-03-16 18:11:36 +00:00
Jeff Young
1537cbc59c Don't be pedantic about the file format.
It's just another form of nagging.
2018-03-16 16:57:38 +00:00
Kristoffer Ödmark
19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
Wayne Stambaugh
4c6ca81f2c More Coverity scan error fixes. 2015-02-22 16:25:29 -05:00
jean-pierre charras
0e996cac9e Pcbnew: fix Bug #1395594 (pcbplotparams parser sensitive to formatting)
Looked like a minor issue, but was due to a more serious bug, when using 2 different DSN_LEXERS which were not synchronized.
The fix is not perfect, but unfortunately, the parser used to read the PCB_PLOT_PARAMS in .kicad_pcb files is also used in legacy board file reader.
Therefore it is better than write 2 parser functions, one for legacy files, the other for the .kicad_pcb files, which make the same thing.
2014-12-04 20:15:26 +01:00
Dick Hollenbeck
acbe6290c5 switch back to original sexpr usage of PTREE, add new DSNLEXER constructor, enforce accessors in kicad.exe 2014-07-07 14:49:14 -05:00
Dick Hollenbeck
611592029f fix Inner1.Cu in pcb_parser.cpp, start cvpcb work. 2014-07-05 15:42:59 -05:00
Dick Hollenbeck
4f7c7eb174 Make pretty prettier by striving for single line module pads. Add slick std::string based strprintf(), twice. 2013-09-26 00:29:54 -05:00
Dick Hollenbeck
8c2d3d12fc comment improvements 2013-07-09 00:22:08 -05:00
Dick Hollenbeck
caf5fc8d8d DSNLEXER::NextTok() organizes the specctraMode code better, into one if block mostly.
This keeps it out of the KiCad mode path, making that leaner and less confusing about
what is supported in KiCad mode.  Within KiCad mode, treat quoted vs. non-quoted tokens
as the two general categories, with non-quoted having sub-categories.  Eliminate  
an unimplemented, unused function declaration in DSNLEXER.
 
Improve the output formatting of THROW_PARSE_ERROR().
2013-07-01 01:47:36 -05:00
Dick Hollenbeck
44d31a1897 Speed up DSNLEXER::findToken() to such an extent that it resulted in an approximate 13% reduction
in *.kicad_pcb file loading times.
2013-06-30 20:05:40 -05:00
Dick Hollenbeck
1f9ee2e45e Support for 'initial single line comments' in the pretty footprint format.
This is limited to round tripping the lines of commented text in the
loading and saving to disk through PCBIO::Format() and PCBIO::Parse().
No editing of the comments is given.
2013-06-23 14:18:33 -05:00
Dick Hollenbeck
98086a8891 Change READ_LINE classes to use less virtual functions, and READ_LINE::ReadLine() to return char*
which can eliminate a subsequent call to READ_LINE::Line() for a small performance gain.
2012-11-27 07:50:01 -06:00
Dick Hollenbeck
5634bc3381 move PCB_PARSER into PCB_IO as a member 2012-10-24 13:20:33 -05:00
Dick Hollenbeck
b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Wayne Stambaugh
baa0d7920a EESchema bug fixes and other minor changes (fixes lp:793373).
* Fix debug build warning (lp:793373).
* Changed sheet edit restore and undo to use object copy and replace method.
* Add minimum width and height constraints when resizing sheets that have
  hierarchical pins.
* Fix drag sheet hot key bug.
* Change Doxygen configuration to extract private methods and members
  when creating documentation.
* Fix a bunch of Doxygen comment warnings.
2011-06-07 11:29:01 -04:00
Dick Hollenbeck
fa37d84030 sweet parsing of pins started 2011-03-19 20:59:17 -05:00
Dick Hollenbeck
f8263c0e62 sweet parser work 2011-02-14 00:39:51 -06:00
Dick Hollenbeck
2cda6f4b4f early work on DLL exports for sweet lib, stop using <cstdio> which mingw seems not to like cuz snprintf() 2011-02-03 20:40:47 -06:00
Dick Hollenbeck
604edcac3a ++all:
* DSNLEXER::NextTok() now uses two separate modes to parse quoted strings.
    This gives us the freedom to control our own destiny separate from the
    constraints put on us by the Specctra DSN spec.
  * Added Documentation/s-expressions.txt to explain all this.
  * Enhanced our quoting protocol by moving away from doubling up double quotes
    to a C line escape mechanism.
  * Now support multi-line strings, which when properly escaped, can still be
    read in as a token originating on a single line.
2011-01-30 13:26:03 -06:00
Dick Hollenbeck
6be7640c41 fix minor /new compile error, swig warnings 2011-01-21 01:21:19 -06:00
Dick Hollenbeck
ed8c021f63 ++all:
* TokenList2DsnLexer.cmake now supports comments, which start with a leading
    # character, and may be either on their own line or on a line after a token.
  * DSNLEXER::PopReader() now pops even the last LINE_READER* and returns it.
++pcbnew:
  * SPECCTRA_DB now inherits from new class SPECCTRA_LEXER, which led to a great
    deal of simplification and code factoring.
  * Moved specctra keywords into specctra.keywords.
2011-01-19 14:46:07 -06:00
Dick Hollenbeck
2dd1287141 filter_reader.cpp 2011-01-11 22:51:29 -06:00