Anton Medvedev and GitHub
d0aa2e9136
Improve types pkg ( #668 )
2024-06-05 01:14:25 +02:00
Anton Medvedev and GitHub
c953d0dde1
Refactor types table ( #667 )
2024-06-04 00:08:01 +02:00
Anton Medvedev and GitHub
fee5690347
Refactor checker to use Nature ( #665 )
...
This PR introduces a new concept inside Expr's type checker - Nature.
It's an abstraction other reflect.Type which carries additional information about possible type, methods and builtin function.
I was able to find and fix a few bugs in type checker and optimizer. Implementation of nature concept has proven itself. As well nature will allow to bring more feature for type checker in future.
Why Nature? I was looking for a name to replace Type. Type name already carries much information, as well can be confused with reflect.Type. Nature name should be understood as "nature of the node", same as "type of the node".
2024-06-01 00:09:22 +02:00
Anton Medvedev and GitHub
19b2c3848f
Add checks for nil before string casts in VM ( #654 )
2024-05-17 19:40:20 +02:00
Anton Medvedev and GitHub
696844a709
Refactor lexer ( #653 )
2024-05-17 18:10:26 +02:00
Anton Medvedev
71e349971e
Add better error messages for index out of bounds errors
2024-05-12 11:55:15 +02:00
Anton Medvedev
cea9c8ae86
Add int overflow checks
2024-05-09 17:22:41 +02:00
Anton Medvedev and GitHub
68e3148c1f
Vendor testify ( #642 )
2024-05-08 00:24:35 +02:00
Anton Medvedev
c6cd675d6b
Add default timezone option expr.Timezone()
2024-05-07 23:19:39 +02:00
Anton Medvedev
3ceff1cdb3
Fix printing on conditional/binary nodes
...
Fixes #613
2024-04-16 23:23:12 +02:00
Anton Medvedev
c8f7d22462
Return proper nil from optional chain
...
Fixes #570
2024-04-16 23:11:01 +02:00
Anton Medvedev
c5dfe3a811
Make count() predicate optional
2024-04-13 23:38:35 +02:00
Anton Medvedev
8589d34039
Add sum([]) optimization
2024-04-13 23:16:08 +02:00
Sergey and Anton Medvedev
2c460ecc98
Optimize boolean operations between all, any, none functions ( #626 )
2024-04-13 10:09:16 +02:00
Sergey and Anton Medvedev
721b908494
expr.Operator passes before expr.Env caused error (#606 )
2024-04-13 10:08:46 +02:00
Ganesan Karuppasamy and Anton Medvedev
527f3aacaf
Fix -1 not in [] expressions ( #590 )
2024-04-13 10:08:10 +02:00
Sergey and Anton Medvedev
2be09b2554
Support chzained comparisonc1 < 2 < 3 ( #581 )
2024-04-13 10:08:10 +02:00
bizy
5bb64800db
Compare any arrays
2024-02-28 00:30:33 +07:00
Ganesan Karuppasamy and GitHub
2f8f25a68d
Enhanced min and max built-in functions to Support Arrays of Integers and Floats ( #576 )
...
* Enhanced min and max built-in functions to Support Arrays of Integers and Floats
* Enhanced min and max built-in functions to Support Arrays of Integers and Floats
2024-02-24 21:12:51 +01:00
Anton Medvedev and GitHub
0d43107999
Add concat() builtin ( #565 )
...
* 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
2024-02-16 22:32:35 +01:00
Vladimir Fetisov and GitHub
c7c060ff44
Fix operator overloading ( #554 )
2024-02-08 21:07:58 +01:00
Sergey and GitHub
8d2e6b133c
Add optional array access like foo?.[42] ( #550 )
2024-02-08 12:20:20 +01:00
Sergey and GitHub
a0e2fe3664
Fix string literal slicing error ( #543 )
2024-01-31 18:07:26 +01:00
Anton Medvedev
616653130e
Make AsAny the new default
2024-01-21 11:55:30 +01:00
Anton Medvedev and GitHub
010c934215
Fix race cond in variabels ( #523 )
...
* Add race cond test
* Move variables array to vm
* Resize vars array for different programs
2024-01-13 20:41:14 +01:00
a0db9a6c19
feat: Implement Bitwise and Shift Operator Support ( #496 )
...
Co-authored-by: Ganesan Karuppasamy <[email protected] >
2023-12-25 18:25:26 +01:00
Anton Medvedev
78d561792e
Add timeout to test
2023-12-22 23:09:31 +01:00
Anton Medvedev
ec98bc8cb9
Add custom tests
2023-12-22 22:48:59 +01:00
Anton Medvedev
4744fe1673
Rename test case
2023-12-19 20:58:34 +01:00
Anton Medvedev
6a7a977315
Add additional ember test
2023-12-19 08:40:13 +01:00
Sergey Grebenshchikov and GitHub
3426d4bcce
Fix: checker panic on embedded pointer to struct field ( #500 )
...
* add failing test case: embedded pointer to struct
* fix(dereference embedded pointers to structs)
* add evaluation test for field access and method call on embedded pointer struct
2023-12-18 21:46:31 +01:00
Anton Medvedev
dd73db72ed
checker: forbid accessing custom functions from $env
2023-12-10 10:44:43 +01:00
Anton Medvedev
551d2a7e0f
Use expr-lang/expr
2023-12-03 21:53:01 +01:00
Anton Medvedev
9d12d8fc39
Add expr.WithContext()
2023-11-27 21:52:44 +01:00
Anton Medvedev
885c769c65
Fix type checker for float arguments
...
Fixes #474
2023-11-24 16:50:09 +01:00
Anton Medvedev
6d9b8d819f
Improve type checking for $env
...
Fixes #462
2023-11-16 22:12:50 +01:00
Anton Medvedev
638a454886
Only emit OpEqual{Int,String} for simple types
...
Fixes #461
2023-11-16 21:39:50 +01:00
Anton Medvedev
c364bcffa0
Fix checker panic
...
Fixes #453
2023-11-16 15:49:53 +01:00
Augustin Peyrard and GitHub
fe7f698b81
Fix Fetch and OpDeref ( #467 )
...
* Fix OpDeref allowing to deref pointer of interfaces
Loop over `Ptr` and `Interface` kind and get `Elem`. Also return
directly the `nil` otherwise we might are returning the pointer nil
value and not the base nil.
* Fix deref interface in Fetch
We were only de-referencing pointers, but we can have pointer of
interface or interface obfuscating pointers...
So before trying to fetch anything, just deference fully the
variable.
2023-11-16 12:40:28 +01:00
Anton Medvedev
63496e6fe7
Add type checks for 42 in ["a"] as invalid
2023-09-20 14:00:15 +02:00
hesining and GitHub
a05268880c
Propagate uint32 arguments types in ast ( #438 )
2023-09-12 16:10:41 +02:00
Anton Medvedev
454373abbe
Fix type checker for "in" operator
...
Fixes #426
2023-09-06 10:36:40 +02:00
Anton Medvedev
92dc6c69f6
Fix duration multiplication by integer
2023-08-30 17:45:26 +02:00
Anton Medvedev
76958b5d3f
Fix date manipulation operations
2023-08-30 15:23:33 +02:00
Anton Medvedev
cea6c64ab2
Move tests to builtin_test.go
2023-08-30 12:11:57 +02:00
Anton Medvedev
7f85c0551f
Add countBy()
2023-08-30 12:07:16 +02:00
Anton Medvedev
32f5fde2eb
Replace interface{} with any
2023-08-30 11:25:15 +02:00
Anton Medvedev
3f57b885d4
Add groupBy
2023-08-30 11:14:54 +02:00
Anton Medvedev
b4640153a3
Remove extra disassemble
2023-08-28 22:27:43 +02:00
Anton Medvedev
e37105ef90
Fix float folding optimization
2023-08-28 22:24:46 +02:00