Skip to content

Fix review issues and modernize Go type aliases and workflows#13

Merged
danielgtaylor merged 8 commits into
mainfrom
codex/fix-review-findings
Apr 22, 2026
Merged

Fix review issues and modernize Go type aliases and workflows#13
danielgtaylor merged 8 commits into
mainfrom
codex/fix-review-findings

Conversation

@danielgtaylor
Copy link
Copy Markdown
Owner

This pull request introduces Unicode-aware string operations to the interpreter, ensuring string length, indexing, and slicing operate on runes rather than raw bytes. Additionally, it updates the codebase to use Go's any type instead of interface{} for improved readability and modern Go compatibility. The PR also includes enhancements to logical operator evaluation, test coverage for Unicode strings, and workflow dependency updates.

Unicode-aware string handling:

  • Added helper functions (stringLength, stringIndex, stringSlice) to ensure string length, indexing, and slicing operate on Unicode code points (runes), not bytes. Updated all relevant interpreter logic to use these helpers, which fixes issues with multi-byte characters. [1] [2] [3] [4] [5] F4c5f641L4R4, F4c5f641L4R4, F4c5f641L16R17, F4c5f641L46R47, F4c5f641L84R97, F4c5f641L123R136, F4c5f641L136R149)

  • Updated documentation to clarify that string operations are Unicode-aware, and added related tests for strings with multi-byte characters (e.g., "éclair", "héllo"). [1] [2]

Type and API modernization:

Interpreter logic improvements:

  • Refined logical operator (and, or) evaluation to use short-circuit logic, ensuring correct behavior when operands are missing or falsy. [1] [2]
  • Improved error messages for type incompatibility and added more robust handling for map membership checks (using key existence rather than value non-nilness). [1] [2] [3]

Test suite enhancements:

  • Expanded test cases to cover Unicode string handling, logical operator edge cases, and map membership with null values. [1] [2]

CI and documentation updates:

  • Updated GitHub Actions workflow to use the latest versions of dependencies and to read the Go version from go.mod.
  • Improved documentation and examples to reflect new API usage and Unicode support. [1] [2] [3]

These changes collectively improve the correctness, maintainability, and modernity of the codebase, especially for internationalization and Unicode support.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the expression engine to be more Unicode-correct and modern Go idiomatic, while refining interpreter behavior and CI configuration.

Changes:

  • Make string length/index/slice operations Unicode-aware (rune-based) in the interpreter and add related tests.
  • Modernize public/internal types by replacing interface{} with any and improving type-checking behavior for mixed schemas.
  • Improve logical operator short-circuiting, map membership semantics, lexer string error handling, and CI workflow dependencies.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
typecheck.go Adds schema merging to better infer array/object item types and propagates unknown more consistently.
parser.go Switches AST Value to any and adds [:] parsing, with slice node value handling updated.
lexer.go Changes string tokenization to return an error on unterminated strings.
conversions.go Adds Unicode-aware string helpers (stringLength, stringIndex, stringSlice) and updates helpers to use any.
interpreter.go Uses rune-aware string ops, refines and/or short-circuiting, and fixes map membership checks for null values.
interpreter_test.go Expands coverage for Unicode string behavior, short-circuiting edge cases, and map membership with null.
error.go Modernizes NewError varargs from ...interface{} to ...any.
README.md Updates examples for any, parser usage, options usage, and documents rune-aware string semantics.
.github/workflows/ci.yaml Updates Actions dependencies and configures Go version via go.mod.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread interpreter.go Outdated
Comment thread interpreter.go
Comment thread lexer.go
Comment thread conversions.go Outdated
Comment thread README.md Outdated
Comment thread parser.go Outdated
Comment thread parser.go
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread interpreter.go
Comment thread interpreter.go
Comment thread conversions.go Outdated
Comment thread parser.go
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lexer.go Outdated
Comment thread README.md
@danielgtaylor danielgtaylor merged commit 7e0b50b into main Apr 22, 2026
1 check passed
@danielgtaylor danielgtaylor deleted the codex/fix-review-findings branch April 22, 2026 17:05
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