App: extend Expression syntax

* Support sub-object reference syntax using the following syntax,
    Part.<<Box.>>.Placement
  or, with sub-object label referencing
    Part.<<$Cube.>>.Placement

* Extend indexing support, including range based indexing, e.g.
    A1[B2+1][C3][D4:-1]

* Add new constants, None, True, true, False, false.
This commit is contained in:
Zheng, Lei
2019-08-29 18:53:51 +08:00
committed by wmayer
parent 22fede14d8
commit a1417c5ffa
10 changed files with 7670 additions and 7381 deletions

View File

@@ -692,7 +692,11 @@ void Sheet::updateProperty(CellAddress key)
auto number = freecad_dynamic_cast<NumberExpression>(output.get());
if(number) {
long l;
if (!number->getUnit().isEmpty())
auto constant = freecad_dynamic_cast<ConstantExpression>(output.get());
if(constant && !constant->isNumber()) {
Base::PyGILStateLocker lock;
setObjectProperty(key, constant->getPyValue());
} else if (!number->getUnit().isEmpty())
setQuantityProperty(key, number->getValue(), number->getUnit());
else if(number->isInteger(&l))
setIntegerProperty(key,l);