Closed goxiaoy closed 1 year ago
Is it possible to take advantage of existing dart parsers out there such as https://pub.dev/packages/expressions or something more fundamental like https://pub.dev/packages/petitparser ?
@laogao Thanks for your reference. We need more time to investigate those packages, and they might help us to reduce the implementation and maintainance difficulty of path 1
I've researched PEG a bit. petitparser came up during my research. From my investigation, there didn't seem to be many good dart PEG parsers. But finding one would make implementing conditions pretty seamless.
implemented with js engine. would close via 3b6eb9a8274a16876dfcdac3ad6e4254f20b97ee
The surveyjs javascript use pegjs to parse expression, and use condition runner to provide logic features
original codes : https://github.com/surveyjs/survey-library/tree/master/src/expressions https://github.com/surveyjs/survey-library/blob/master/src/conditions.ts https://github.com/surveyjs/survey-library/blob/master/src/conditionsParser.ts https://github.com/surveyjs/survey-library/blob/master/src/conditionProcessValue.ts