5 Commits

Author SHA1 Message Date
Joseph Lenox
548ce534ad added another couple tests to catch a few more expressions according to spec. 2018-04-12 20:23:47 -05:00
Joseph Lenox
8ca6171a0a Fix test and really emit {} on parse failure. 2017-11-06 22:03:27 -06:00
Joseph Lenox
f7e6d53e06 Allow the use of escaped open/close brackets so that brackets may be emitted in the output (does not permit use of {} inside evaluations).
Fixes behavior to emit brackets on failure.

Fixes #4180
2017-11-06 22:00:21 -06:00
Joseph Lenox
f366700b44 Emit original string on failure to parse. 2017-11-06 21:11:17 -06:00
Joseph Lenox
202a90ff90 Math evaluation in gcode (#4157)
* Prototype gcode infix math, very basic.

* Adding exprtk math parser library, header only.
@ArashPartow
https://github.com/ArashPartow/exprtk@4e1315a87dcc99a1ccad21fae1def0c2d4913c0f

* Now evaluating strings with exprtk, only support no variables in input
strings.

* Moved executable code to cpp file, stubbed out xsp and let the testing begin...

* Added conditional gcode parser into export path, added tests.

* Added one more test to ensure that {if0} only removes up to newlines.

* Test failure to parse

* Add some compiler flags to compile out stuff from exprtk

* Fix debug messages to be more specific, don't use deleted stringstream = method.

* Trade expression speed for apparently around 50MB of object size.

* Removed an extra trim that was breaking existing tests.

* fix test

Fixes #3390
2017-10-20 21:40:05 -05:00