* export the checker and ensure no methods or fields are exported
* make Checker reusable
* add PatchAndCheck method to Checker, and reuse it in visitors
* avoid unnecessary map and consolidate structs
* make all Nature methods use pointer-receiver
* added cache for type and nature information
* optimize type and nature checks
* more aggressively cache some partial results and add cheap checks
* cache reused values
* reduce copying in Nature by breaking down optional fields
* enforce use of cache
* improve ergonomics of FromType and NatureOf
* improve struct method fetching
* make cache private to Nature
* first iteration improving struct reflect caching
* cleaned up struct fields data
* improve caching of functions data
* simplify checker code
* simplify and remove dead code
* add checker benchmarks
* address PR comments and minor improvements
* rename from SetCache to Bind
* make the benchmarks more fair
* fix benchmark option not being applied
* move Cache to be argument instead of field
* merge FuncData into Optional
* rename Optional to TypeData
* simplify struct logic
* cache builtin numeric types
---------
Co-authored-by: Anton Medvedev <[email protected]>
* convert source to a struct and fix minor issue displaying error
* lexer: add byte and char pos
* improve parser to use string instead of []rune
* add lexer benchmarks
* make lexer work as an iterator
* make parser use the new iterator API in lexer
* allow reusing the parser
* cleanup code
* add parser benchmarks
Expand test coverage to newer Go versions and fix compatibility issues:
- Add Go 1.23 and 1.24 to test matrix in test.yml
- Add Go 1.24 to build matrix in build.yml
- Fix example test names to match Go conventions:
* ExampleOperator_Decimal → ExampleOperator_with_decimal
* ExampleWithTimezone → ExampleTimezone
* ExampleGetUnifiedDiffCode → ExampleGetUnifiedDiffString
* ExampleGetContextDiffCode → ExampleGetContextDiffString
* ExampleGetContextDiffString → ExampleGetContextDiffString_second
These changes maintain compatibility with Go 1.18 (as specified in
go.mod) while ensuring the codebase works correctly with the latest
Go versions, which enforce stricter naming conventions for example
tests.
Signed-off-by: Ville Vesilehto <[email protected]>
Co-authored-by: Anton Medvedev <[email protected]>
* Add concat() builtin
* Use pkg deref in builtin
* Use pkg deref in checker
* Use pkg deref in types_table.go
* Use pkg deref in docgen.go
* Use pkg deref in vm
* Update vm.go
golang gotcha: reflect calls with nil params fail without this trick
* Update vm.go
* Problem with passing "nil" when operators are overloaded with interface{} type parameters fixed
e.g.
a != nil
was not working when "!=" is overloaded with
func notEqual(a, b interface{}) interface{} {...}
* Compile fix
Forgot to close ")"
* Added test that illustrates what did not work when using overloaded operators and passing nil
* Updated test for overloaded eaqal with using nil
a == b replaced with a == nil to illustrated the problem when using nil directly in expression
* Fixed the problem for untyped nil
We use the trick only for untyped nil:
https://play.golang.org/p/MyAztoZaqhx
* Refactor call procedure
Co-authored-by: wintermute-cds <[email protected]>