Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1461 Flecs script expression refactor
* Initial commit for new expression parser * Implement type visitor for binary expressions * Implement type visitor for remaining nodes * Add unary expression * Implement folding for unary and binary expressions * Implement cast expressions * Move expression implementation to its own folder * Fix folding issues * Fix issues with operator precedence * Implement initializer expressions * Add multiline string support * Don't use static offsets for opaque types * Implement basic expression eval runtime * Remove legacy expr implementation * Implement unary expression support for runtime * Implement initializer expression support for runtime * Implement element expression support for runtime * Implement accessing elements of inline array * Implement component expressions for runtime * Implement basic function support for scripts * Implement expression AST cleanup * Implement support for dynamic initializers * Improve management of non-trivial temporary values * Implement deducing variable name from initializer member * Fix issue with array initializers * Implement separate public functions for parsing/evaluating expressions * Add tests that ensure expr parser stops at right location * Integrate script and expression parsers * Fix warnings * Implement expression stack for runtime * Implement reusable script runtime object * Fix more warnings * Make expression folding optional * Fix query parser regression * Fix more warnings * Fix script memory mgmt issues, extend allocator with more debug info * Unquarantine expression error checking tests * Implement support for function arguments * Implement flecs script math functions * Add section on expressions to Flecs Script manual * Add flecs script examples * Implement ability to specify variables and runtime to ecs_script_eval * Improve naming of script API * Add more script examples * Fix template instantiation issue while world is deferred * Allow for infinitely nested observer events * Fix issues with parsing initializers * Fix issue where value of component defined in script was freed after component was deleted * Fix issue where suspending/resuming readonly mode could corrupt stack allocator * Allow for trailing commas in collection initializers * Fix issues with template variable hosting * Implement detection of invalid components in with scope, allow for N template instances per entity * Fix operator precedence issue, ensure Template pair is always a tag * Fix issue with using ecs_entity_desc_t::set while deferring is suspended * Implement folding of const variables * Improve type inferencing in boolean expressions * Fix illegal memory access in ecs_add_path_w_sep * Remove unused ecs_stage_t::parser_tokens member * Add reusable script runtime to stage, reduce allocations during template instantiation * Fix memory leaks from casting non-trivial values * Fix leaks when using FLECS_USE_OS_ALLOC * Fix issue where code was accessing world->flags on stage object * Implement ability to define global script variables * Reimplement string interpolation for expression parser * Implement support for entity name expressions * Implement support for for range loops * Add flecs.script.math.abs * Fix issue with mod operator, check for division by zero * Fix issue with reporting errors that contain format characters * Implement divide by zero detection in fold visitor * Implement improved error checking for templates * Improve type conversion error messages * Fix issue with templates that contain expressions with self references * Fix issue where global with was applied to template code * Fix issue with for loops in templates * Fix issues with parsing binary expressions without spaces * Fix memory leaks * Fix fuzzing errors - Fix invalid write in flecs_path_append - Correctly handle name lookups with multiple consecutive separators - Correctly handle attempts to create entities with ids > UINT32_MAX - Improve cycle detection in observer code/prevent stack overflows * Fix memory leaks in meta cursor string conversions * Fix warnings, add typos exception for Fuzzing.c * Fix access to uninitialized ecs_cmd_t::id field * Add more sections to script manual - String entity names - String interpolation - For loops - Updated section on types - Added C examples on how to define functions/methods * Add more builtin script functions, add documentation on builtin functions
- Loading branch information