Skip to content

Commit

Permalink
#1461 Flecs script expression refactor
Browse files Browse the repository at this point in the history
* 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
SanderMertens authored Dec 15, 2024
1 parent 2b2ca14 commit 1f4c816
Show file tree
Hide file tree
Showing 128 changed files with 35,912 additions and 14,551 deletions.
2 changes: 1 addition & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
files.extend-exclude = ["distr/*"]
files.extend-exclude = ["distr/*", "test/script/src/Fuzzing.c"]

# typos can't handle "2nd" as a word (yet?)
default.extend-ignore-identifiers-re = ["_2nd"]
Expand Down
Loading

0 comments on commit 1f4c816

Please sign in to comment.