Skip to content

builtins: add upr lwr cap string-case ops#190

Merged
danieljohnmorris merged 1 commit into
mainfrom
fix/string-case-builtins
May 12, 2026
Merged

builtins: add upr lwr cap string-case ops#190
danieljohnmorris merged 1 commit into
mainfrom
fix/string-case-builtins

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Case normalization is table stakes for text handling. upr lwr cap close that gap.

Implementation:

  • upr uppercases, lwr lowercases, cap title-cases first character
  • operates on UTF-8, preserves scalars outside ASCII case-pair range
  • opcodes allocated: upr, lwr, cap

Tests: cross-engine regression tests + examples/string-case.ilo with -- run: directives.

@danieljohnmorris danieljohnmorris force-pushed the fix/string-case-builtins branch from 1524e49 to e6818c7 Compare May 12, 2026 10:00
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 75.80645% with 45 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/vm/compile_cranelift.rs 16.00% 21 Missing ⚠️
src/interpreter/mod.rs 58.62% 12 Missing ⚠️
src/vm/mod.rs 86.51% 12 Missing ⚠️

📢 Thoughts on this report? Let us know!

Case normalization is table stakes for any text-handling language.
upr uppercases, lwr lowercases, cap title-cases the first character.
All three operate on the underlying UTF-8 string and preserve scalars
outside the ASCII case-pair range.

Opcodes allocated: upr, lwr, cap. Single-arg, single-return, no
allocation surprises.
@danieljohnmorris danieljohnmorris force-pushed the fix/string-case-builtins branch from e6818c7 to 66a4088 Compare May 12, 2026 22:27
@danieljohnmorris danieljohnmorris merged commit a2d281f into main May 12, 2026
4 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/string-case-builtins branch May 12, 2026 22:29
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.

1 participant