Skip to content

Conversation

@johnnyt
Copy link
Member

@johnnyt johnnyt commented Aug 31, 2025

Implements namespace.function() syntax for SCXML compatibility. Adds JSONFunctions
module with stringify/parse and MathFunctions module with complete mathematical
operations (pow, sqrt, abs, floor, ceil, round, min, max, random). Functions are
automatically available in all evaluations without explicit registration.

Key features:

  • Qualified identifiers: JSON.stringify(), Math.pow(), etc.
  • Auto-registration: Functions available by default in evaluator
  • Full SCXML spec: Compatible with SCXML function requirements
  • Clean separation: SystemFunctions (strings/dates), MathFunctions (math), JSONFunctions (serialization)

This captures the main functional change (qualified functions for SCXML compatibility)
while highlighting the key user-facing features and the architectural improvement of
separating function concerns.

Co-Authored-By: Claude noreply@anthropic.com

johnnyt and others added 3 commits August 30, 2025 19:08
Implements namespaced function calls like JSON.stringify() and Math.pow()
for SCXML compatibility. Includes complete lexer and parser support for
qualified identifiers, plus comprehensive JSONFunctions and MathFunctions
modules.

Key features:
- Qualified identifier tokenization (JSON.stringify, Math.pow, etc.)
- Parser support for namespace.function() syntax
- JSONFunctions module with stringify/parse methods
- MathFunctions module with pow, sqrt, abs, floor, ceil, round, min, max, random
- Comprehensive test coverage (69 new tests)
- Thread-safe function registration via evaluator options
- Full SCXML specification compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixes minor formatting issues in documentation including
missing newlines and consistent section spacing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removes abs/max/min from SystemFunctions (now in MathFunctions) and
resolves all Credo warnings: implicit try blocks, consistent variable
naming, and proper module aliases in tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

❌ Patch coverage is 88.88889% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/predicator/functions/json_functions.ex 76.92% 3 Missing ⚠️
lib/predicator/lexer.ex 89.28% 3 Missing ⚠️
lib/predicator/parser.ex 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
lib/predicator/evaluator.ex 90.90% <100.00%> (-0.10%) ⬇️
lib/predicator/functions/math_functions.ex 100.00% <100.00%> (ø)
lib/predicator/functions/system_functions.ex 100.00% <ø> (ø)
lib/predicator/parser.ex 85.50% <50.00%> (-0.27%) ⬇️
lib/predicator/functions/json_functions.ex 76.92% <76.92%> (ø)
lib/predicator/lexer.ex 96.36% <89.28%> (-1.59%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johnnyt johnnyt merged commit 7588e24 into main Aug 31, 2025
13 checks passed
@johnnyt johnnyt deleted the add-system-functions branch August 31, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants