Skip to content

Enhance expression evaluation and update event sheet resources#85

Open
Lexian-droid wants to merge 3 commits intomasterfrom
new-evaluation
Open

Enhance expression evaluation and update event sheet resources#85
Lexian-droid wants to merge 3 commits intomasterfrom
new-evaluation

Conversation

@Lexian-droid
Copy link
Copy Markdown
Member

This pull request introduces significant improvements to the FKExpressionEvaluator in FlowKit, primarily adding type validation to expression evaluation and updating event sheet resources to use explicit string quoting for literal values. The evaluator now validates result types against expected types, and event sheet .tres files have been updated for consistency with the new evaluation logic.

Core Expression Evaluation Improvements

  • The evaluate function in expression_evaluator.gd now takes an optional expected_type parameter, validating the result type after evaluation. If the type does not match, an error is pushed. The evaluation no longer falls back to returning the raw string if evaluation fails, but instead returns null and logs an error. [1] [2]
  • Literal and expression parsing functions (_try_parse_literal, _evaluate_expression) now return [found: bool, value: Variant] arrays to distinguish between "not found" and "found with null value" cases, improving reliability and error handling. [1] [2] [3]
  • Added utility functions: _check_type for validating result types, and type_name_to_variant_type for mapping string type names to Godot Variant types.

Bulk Event Sheet Updates for Literal Quoting

API Enhancements

  • The evaluate_inputs function now accepts an optional type_hints dictionary, allowing per-input type validation during batch evaluation.

These changes improve the safety, predictability, and clarity of expression evaluation in FlowKit, and ensure event sheet resources are compatible with stricter type handling.

…idation; update event sheet resources to escape string values.
@Lexian-droid Lexian-droid added the enhancement New feature or request label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant