Skip to content

v1.2.0

Choose a tag to compare

@aki-null aki-null released this 01 Oct 12:45
· 89 commits to master since this release

Added

  • Period characters in identifiers: Variable names and function names can now contain periods (e.g., user.name, math.square())
  • VariableId struct: Strongly-typed variable identifier that replaces direct uint usage
    • Provides implicit conversions to/from uint and string for backwards compatibility
    • Maintains internal unique identifier mapping through extension methods
    • Improves type safety and encapsulates identifier management
  • Boolean Short-Circuit Optimization: Compile-time optimization for boolean expressions
  • String variable support with integer parsing
  • Support for CustomFunction.Create with zero-parameter functions that have return values (Func<TResult>)
  • AddCustomFunctionRange(IEnumerable<CustomFunction> functions) method for adding multiple custom functions at once
  • Documentation clarification on function purity requirements

Fixed

  • Unity Compatibility: Added conditional compilation support for Unity's UnsafeUtility.As API in TypeTraits.cs
  • AST Optimization: Fixed Compiler.cs optimization pipeline where rootNode.Optimize() result was being discarded instead of captured, causing some AST optimizations to be ignored
  • Constant Function Folding: FunctionNode.Optimize() now evaluates constant functions with constant parameters at compile time
  • Sign Operator Optimization: Fixed unary positive operator (+expr) returning unoptimized child node instead of optimized result
  • Trailing Semicolon Support: Trailing semicolons are now allowed and treated as no-op instead of throwing "Cannot find tokens to sequence" error

Changed

  • BREAKING CHANGE: IVariableContainer.TryGetValue() now takes VariableId instead of uint
    • Existing implementations must be updated to use VariableId parameter
    • Most calling code continues to work due to implicit uint → VariableId conversion
  • AST Node Build() method signatures updated to use IDictionary<VariableId, CustomFunctionOverload>
  • Internal function dictionaries now use VariableId keys instead of uint
  • Comparison operators <= and >= now use direct operations instead of < || == and > || ==
  • Eliminated direct calls to GetUniqueIdentifier() and GetStringFromUniqueIdentifier() in favor of VariableId implicit conversions

Migration Guide

For custom IVariableContainer implementations:

// Before
public bool TryGetValue(uint variableKey, out VariableValue variableValue)

// After
public bool TryGetValue(VariableId variableKey, out VariableValue variableValue)

Most existing code using uint variable identifiers will continue to work due to implicit conversions.