Jeff Young
6cec58cf75
Add field access to custom DRC rules.
ADDED getField() method to custom DRC rules.
4 years ago
Jeff Young
1a252b4f96
Add a compile error for ill-defined rules, and more performance.
Also adds const-safety to GetBoard().
4 years ago
Jeff Young
6aaf4413b3
Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
4 years ago
Wayne Stambaugh
6c3ba1c20b
Coverity issue fixes.
Issues #332032 , #332086 , #332157 , and #332171 .
4 years ago
Wayne Stambaugh
65c7958293
Coverity issue fixes.
Issues #331869 , #331875 , #332203 , #332159 , #332171 , #332180 , and #332648 .
4 years ago
Marek Roszko
cf2bb5692a
Remove the wxLog calls from math/util.h for now
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
5 years ago
Jeff Young
4a77a4080d
Fix Coverity warning.
5 years ago
Jeff Young
e93e9fa3e5
Add rudimentary type checking to rule eval with reporter.
Also cleaned up existing error reporting to not expend CPU cycles
when there was no reporter.
Fixes https://gitlab.com/kicad/code/kicad/issues/8438
5 years ago
Jeff Young
b1fa02bcc8
Push a non-existent ref's value as 0. (Don't just crash.)
Fixes https://gitlab.com/kicad/code/kicad/issues/7971
5 years ago
Jon Evans
5c17ff0595
Libeval: don't try to dereference invalid STRUCT_REF parent
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7764
5 years ago
Jeff Young
1ce1e493d6
A rule zone is not really a BOARD_CONNECTED_ITEM.
Or at least it shouldn't always be treated as one.
Fixes https://gitlab.com/kicad/code/kicad/issues/6382
5 years ago
Ian McInerney
31e626f279
Cleanup creation of all our smart pointers
5 years ago
Jeff Young
948036372e
Ban unitless numbers in DRC rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/6029
5 years ago
Marek Roszko
a1c75748a0
Remove GetChars(), a wxWidgets 2.9 compatibility hack
5 years ago
Jeff Young
ebd5dc81cc
Fix some more cases of malformed syntax crashing the compiler.
Fixes https://gitlab.com/kicad/code/kicad/issues/6016
5 years ago
Jon Evans
f7d3dddd6d
Fix format argument assertion in libeval_compiler
5 years ago
Roberto Fernandez Bautista
39995341d9
Compile fixes
Fix compile error
Fix string format to use %ld instead to work on clang in CADSTAR Archive importers
Add virtual destructor to CONNECTION in CADSTAR_ARCHIVE_PARSER
5 years ago
Tomasz Wlostowski
78fc0349a9
libeval_compiler: free tree in destructor, warning fixes
5 years ago
Tomasz Wlostowski
d2ed27b500
libeval_compiler: fix string comparison
5 years ago
Tomasz Wlostowski
0c885c9c31
libeval_compiler: == operator now does wildcard string comparison
5 years ago
Tomasz Wlostowski
5023d9a780
libeval_compiler: initial support for multiple (>1) function/method arguments
5 years ago
Jeff Young
0763a8962c
Implement boolean not processing in expression language.
Also adds some more error catching to be more robust in the face
of malformed customer rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/5694
5 years ago
Jeff Young
80acf944a0
Don't assert when compiling rules; generate a user-visible error.
Fixes https://gitlab.com/kicad/code/kicad/issues/5694
5 years ago
Tomasz Wlostowski
712215fe12
libeval_compiler: fix crash when preflighting method calls with 0 arguments
5 years ago
Tomasz Wlostowski
466cbe2f00
libeval_compiler: fixhandling of method calls with empty argument list (e.g. 'A.method()' )
5 years ago
Jeff Young
a35698f08a
Don't fire non-well-formed rules. (But don't assert either.)
Fixes https://gitlab.com/kicad/code/kicad/issues/5443
5 years ago
Jeff Young
050bbcdb4f
Fix error reporting from function pre-flighting.
5 years ago
Jeff Young
d7f26cfdf2
Fix test failures.
5 years ago
Jeff Young
b42395ec8d
Attempt to fix locale issue with decimal separator in rules.
5 years ago
Jeff Young
ec5040aff5
Fix missing 'else' and EOF processing, both of which cause crashes.
5 years ago
Jeff Young
edda024285
Fix up some Coverity and CLion warnings.
5 years ago
Tomasz Wlostowski
ab17f4b7b5
libeval_compiler: thou shalt not use strlen() on wxStrings. Works under Linux, doesn't work on OSX/MSVC...
5 years ago
Jeff Young
519bc80394
Replace error reporting in DRC rule compiler.
5 years ago
Jeff Young
0b17dbd123
Fix nesting issues in the DRC rule expression code generator.
We were executing function calls multiple times because we were
processing them at a depth the traversal algorithm wasn't expecting.
5 years ago
Tomasz Wlostowski
518a659185
Post-rebase fixes
5 years ago
Tomasz Wlostowski
4abe71d2ef
libeval_compiler: implemented unary +/- operators
5 years ago
Tomasz Wlostowski
c88c8102e5
libeval_compiler: fixed segfault for "(number)" expressions.
5 years ago
Tomasz Wlostowski
a5a06e3c89
libeval_compiler: general clean up of the Lemon grammar + some smart pointers + killed all memory leaks. WIP!
5 years ago
Tomasz Wlostowski
29a01e5515
libeval_compiler: wxString()-ification WIP
5 years ago
Jeff Young
17d3e36bd6
Fix crash bug when condition expression is empty.
5 years ago
Ian McInerney
0a1d8c1aaa
Move lemon parser generation into build directory
This moves the generated files out of the source tree and into
the build directory. They are now regenerated each time they are
needed, based on the timestamp of the generated file compared to
the timestamp of the lemon file.
To do this, we also bundle lemon into the thirdparty directory
and build it for ourselves since it is a very tiny program and
not all platforms seem to distribute it in a consistent manner.
Fixes https://gitlab.com/kicad/code/kicad/issues/5013
5 years ago
Jeff Young
7e63376266
Fix typo in DRC rule error reporting that causes crash.
5 years ago
Ian McInerney
268dec5c19
Cleanup some build and Coverity warnings
5 years ago
Jeff Young
577c1be391
Report all DRC rule errors, not just the first.
5 years ago
Tomasz Wlostowski
fe4695719d
libeval_compiler: post-rebase fixes
5 years ago
Tomasz Wlostowski
3c80b98d1c
libeval_compiler: CONTEXT runs the UCODE now (thread-safe solution), fixed some memory leaks
5 years ago
Tomasz Wlostowski
abe6ccf97e
common: re-enable libeval_compiler and DRC proto test (fixed missing file issues)
5 years ago
Jeff Young
2ea5528cd0
Start compiling identifiers.
We'll need this if we support the "L == foobar" syntax, and besides
it should really be up to the parser client whether or not they use
identifiers with no function call or property reference.
It also allows us to generate error messages for unknown identifers.
5 years ago
Jeff Young
8a010bc23e
Null safety for expression variables.
5 years ago
Jeff Young
552dde8976
Fix return value going out of scope.
(From Coverity report.)
5 years ago