970 Commits
Author SHA1 Message Date
Simon WaldherrandGitHub 42eec6f21f Fix typos (#686) 2024-07-14 09:07:58 +02:00
Arik CohenandGitHub dfa34e25bc Add Tork to its list of users (#682)
Signed-off-by: Arik Cohen <[email protected]>
2024-07-04 23:49:14 +02:00
zhuliquanandGitHub b74ed56efa Fix unary node print for conditional expr (#676)
* feat: extract code for compiling equal operator

* fix: fix unary node inside condition node print
2024-06-23 21:20:41 +02:00
Anton Medvedev 0217bda141 Add any type 2024-06-14 09:32:52 +02:00
Anton Medvedev b24b1448ed Add types.Equal 2024-06-14 09:23:26 +02:00
Anton Medvedev d2777e110d Add types.Array() 2024-06-05 15:48:40 +02:00
Anton MedvedevandGitHub d0aa2e9136 Improve types pkg (#668) 2024-06-05 01:14:25 +02:00
Anton MedvedevandGitHub c953d0dde1 Refactor types table (#667) 2024-06-04 00:08:01 +02:00
Anton Medvedev de9d6dcf8a Remove Node.Kind() method 2024-06-01 14:57:15 +02:00
Anton MedvedevandGitHub 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 1960bc8e9d Improve compilation for detached tree parts 2024-05-30 21:45:13 +02:00
Anton Medvedev cd8bf976e1 Fix check.yml 2024-05-27 12:28:18 +02:00
Anton Medvedev 9ea9a6e184 Fix coverage reporting 2024-05-27 12:25:09 +02:00
Anton MedvedevandGitHub 0308dbbbb4 Fix function calls with int64 params (#663)
Fixes #661
2024-05-27 12:05:19 +02:00
e944648160 Add MelrĹŤse to "Who uses Expr?" section
Co-authored-by: Anton Medvedev <[email protected]>
2024-05-24 10:12:54 +02:00
Ganesan KaruppasamyandGitHub b53d7bdcfd Invoke the Deref function as needed for the function arguments. (#651) 2024-05-21 11:10:48 +02:00
Anton Medvedev c8b0171f3a Return tree on parse errors 2024-05-18 23:41:49 +02:00
Anton Medvedev 0d07afb7ae Add checker.ParseCheck func 2024-05-18 23:13:58 +02:00
Anton Medvedev 0a33193f26 Fix build for 386 and add build.yml workflow 2024-05-17 21:40:50 +02:00
Anton MedvedevandGitHub 19b2c3848f Add checks for nil before string casts in VM (#654) 2024-05-17 19:40:20 +02:00
Anton MedvedevandGitHub 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 7af1ec6a15 Improve now() and date() validation 2024-05-08 22:27:02 +02:00
Anton Medvedev 1ae9d68e8f Update docs 2024-05-08 22:20:37 +02:00
Anton Medvedev 77e80fe655 Remove implicit date's timezone set on parse 2024-05-08 10:04:54 +02:00
Anton Medvedev c2418bddaf Add go 1.22 to tests 2024-05-08 00:25:10 +02:00
Anton MedvedevandGitHub 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 1659126046 Add timezone() builtin 2024-05-07 21:36:22 +02:00
Ganesan KaruppasamyandGitHub 36482dfa5a Resolve double-escaping issue with pair node key (#640)
* Resolve double-escaping issue with pair node key

* Resolve double-escaping issue with pair node key

* Added test cases for pair node key
2024-05-07 21:07:12 +02:00
Christian G. WardenandGitHub cb48887b9f Preserve The Specified Timezone In Parse (#633)
* Preserve The Specified Timezone In Parse

When parsing a string into a Time using the optional timezone
parameter, set the location of the Time to the timezone's location so
that Format uses that timezone.

* Add More Tests for Preserving Timezone

Add test when timezone is used to parse a date-time.

Add test when timezone is irrelevant because it's a date.
2024-04-24 14:08:49 +02:00
gnolizuhandGitHub be7ee98cb8 New usage case: xiaohongshu.com (#631)
add company usecase of xiaohongshu.com

Signed-off-by: gnolizuh <[email protected]>
2024-04-22 12:05:36 +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 199f26c7e3 Update sortBy docs 2024-04-14 08:56:31 +02:00
Anton Medvedev ba3bae5017 Add more optimizer tests 2024-04-13 23:50:53 +02:00
Anton Medvedev c5dfe3a811 Make count() predicate optional 2024-04-13 23:38:35 +02:00
Anton Medvedev d8d1d9ebf4 Code style 2024-04-13 23:18:59 +02:00
Anton Medvedev 8589d34039 Add sum([]) optimization 2024-04-13 23:16:08 +02:00
Anton Medvedev 27b20607f1 Add sum(map()) optimization 2024-04-13 22:50:11 +02:00
Anton MedvedevandGitHub 772eaba1ca Add predicate to sum() builtin (#592)
* Add predicate to sum() builtin

* go mod tidy
2024-04-13 15:37:02 +02:00
Anton Medvedev 01014b4c50 Merge compare-arrays 2024-04-13 10:11:06 +02:00
DaenneyandAnton Medvedev 1934e4eaee Make WithContext work for methods on env struct (#602)
This makes the WithContext patcher work when passing in a struct for an
env that has methods that take a context.

This is a bit fiddly because we can't quite detect the difference of
function vs. method on a struct, so we have to check both the first and
the second param. Since it's highly unusual to pass the context as
anything other than the first parameter, this should work out just fine
in practice.

Fixes #600.
2024-04-13 10:09:18 +02:00
SergeyandAnton Medvedev 2c460ecc98 Optimize boolean operations between all, any, none functions (#626) 2024-04-13 10:09:16 +02:00
Anton Medvedev 1fab6ed6e0 Revert "Optimize boolean operations between all, any, one, none functions (#555)" (#625)
This reverts commit 8037acf0bb.
2024-04-13 10:08:48 +02:00
needsureandAnton Medvedev 03af7491ad chore: fix some typos in conments (#622)
Signed-off-by: needsure <[email protected]>
2024-04-13 10:08:48 +02:00
Anton Medvedev 858f009587 Update README.md 2024-04-13 10:08:48 +02:00
Richard WoodingandAnton Medvedev 28060656f0 Update README.md (#619)
Add SPAN Digital as an user of expr
2024-04-13 10:08:48 +02:00
zhuliquanandAnton Medvedev 43556eecdd feat: extract code for compiling equal operator (#614) 2024-04-13 10:08:48 +02:00