Jeff Young
9805aca5a0
Handle backslash-escaped quotes in libeval.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15786
2 years ago
Jeff Young
cf1565a16a
Bug fixes for layer expression processing.
1) Push a VAR onto the stack, not a resolved value
2) Don't collapse a PCB_LAYER_VALUE to a VALUE during processing
3) Make sure we run overloaded operators from the correct side
Fixes https://gitlab.com/kicad/code/kicad/issues/12437
3 years ago
Jeff Young
e3e24322bb
Fix typo.
Fixes https://gitlab.com/kicad/code/kicad/issues/12140
3 years ago
Jeff Young
6cec58cf75
Add field access to custom DRC rules.
ADDED getField() method to custom DRC rules.
4 years ago
Tomasz Wlostowski
1051f11683
libeval_compiler: thou shalt not return pointers to std::vector members! (fixes an use-after-free crash in complex rule evaluation invoked by the router)
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9451
4 years ago
Jeff Young
048e13f423
Defer DRC rule function eval to make use of short-circuit bools.
The lemon parser doesn't lend itself to short-circuiting booleans,
but if we defer processing until we fetch the second value when
processing the TR_OP_BOOLEAN opcode then we get to piggy-back on
C++'s boolean short-circuiting.
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
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
Ian McInerney
44655b98de
Initialize variables properly
5 years ago
Jeff Young
63e2046eb0
Performance improvements for DRC rules.
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
Werni
a7d5d1f091
Add more consts all over the place
5 years ago
Marek Roszko
e928b2d8fd
Split EDA_UNITS out from common.
5 years ago
Jeff Young
948036372e
Ban unitless numbers in DRC rules.
Fixes https://gitlab.com/kicad/code/kicad/issues/6029
5 years ago
Jeff Young
09ab269770
Support for 'L' in DRC expression language.
Also make layer testing work again against both canonical names and
user names.
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
6d18f20093
ADDED constraints reporter for diagnosing constraints.
Also fixes an issue with via type property and makes property
comparisons in rule case-insensitive.
Fixes https://gitlab.com/kicad/code/kicad/issues/5754
5 years ago
Mark Roszko
7656663a2f
Fix Python integration to build with vcpkg
* Add vcpkg support to find Oython using CMake
* Fix pid_t conflict with python
* Fix COMPILER conflict with python
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
Tomasz Wlostowski
466cbe2f00
libeval_compiler: fixhandling of method calls with empty argument list (e.g. 'A.method()' )
5 years ago
Jeff Young
050bbcdb4f
Fix error reporting from function pre-flighting.
5 years ago
Jeff Young
edda024285
Fix up some Coverity and CLion warnings.
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
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
84425f5a40
Fix crash bug from bad static_cast.
5 years ago
Jeff Young
f27661fa39
Be more flexible with user input; more multibyte safety.
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
Jeff Young
0fecb5f277
Be more explicit about string/character conversions.
This *may* fix the bug where a layer name isn't displayed correctly
in the error dialog. But probably not.
5 years ago
Jeff Young
552dde8976
Fix return value going out of scope.
(From Coverity report.)
5 years ago
Jeff Young
bf445c1a95
Performance enhancements.
1) cache pad polygon outlines
huge improvement in connectivity performance and a decent
improvement in DRC performance
2) don't pre-allocate CONTEXT stack
significant improvement in DRC rule performance
2) don't keep re-encoding strings
decent improvement in DRC rule performance
5 years ago
Jeff Young
6529e339a9
Don't store context in the uCode. (It's not thread-safe.)
Although it does give some pretty funny results when filling zones.
5 years ago
Jeff Young
f2812773d4
Better handling of undefined values in Rule expressions.
This is particularly important to keep the user from having to
enter overly verbose statements such as:
A.Type == 'via' && A.Via_Type == 'buried'
when:
A.Via_Type == 'buried'
is perfectly clear.
5 years ago
Jeff Young
a6b6084a60
Add preflighting for DRC rule function calls.
5 years ago
Jeff Young
095937563b
Hook libeval compiler up to rule parser
- convert expression string tokens to single-quote-delimited
- fix bug where netclass assignments weren't getting updated after
board setup dialog
- move property manager rebuild to lazy evaluation
- improve performance with wider use of const&
- retire DRC_SELECTOR stuff
- use wxString for GUI stuff (particularly translated stuff)
- fix EqualTo() to return false instead of asserting when op types
don't match
- fix buffer overruns with fixed-size string buffers
- make expression function calls case-insensitive
- integrate expression errors into rule parser
- produce more and better error messages
- keep BOARD_ITEM ptrs const as long as possible
- fix a couple of uninitialized variables
5 years ago
Jeff Young
bcb29b6bf8
Fix security issue (buffer overrun).
5 years ago
Tomasz Wlostowski
49c37014f7
Updated copyright headers in expression evaluator code
5 years ago
Tomasz Wlostowski
3268f98fd7
libeval_compiler: support for method calls (e.g. item.onlayer('layer') )
5 years ago
Tomasz Wlostowski
aaa91655aa
libeval_compiler: integrated in common/
5 years ago