Commit Graph
939 Commits
Author SHA1 Message Date
Anton Medvedev 61219e089c Update examples.txt 2025-03-19 15:29:59 +01:00
Anton Medvedev 69512cb435 gen: fix 2025-03-19 12:32:26 +01:00
Anton Medvedev d179a6e5c5 gen: fix predicate generator 2025-03-19 12:32:03 +01:00
Anton Medvedev 3289edf207 gen: less string vars 2025-03-18 23:57:51 +01:00
Anton Medvedev d79a97301c gen: add $env 2025-03-18 23:54:38 +01:00
Anton Medvedev 22d50fd301 gen: add vars 2025-03-18 23:45:05 +01:00
Anton Medvedev 6a0a8f1ba5 gen: simplify search 2025-03-18 23:38:28 +01:00
Anton Medvedev 1e7796412f gen: use all cpus 2025-03-18 23:20:00 +01:00
Anton Medvedev ab2c230eaf Refactor random code get 2025-03-18 23:08:02 +01:00
Anton MedvedevandGitHub d5f9c1bf84 Fix parsing of variable declaration nodes combined with sequence node (#773)
Fixes #772
2025-03-18 10:49:13 +01:00
Anton Medvedev 99e8ef04a5 Update docs 2025-03-17 14:28:04 +01:00
Anton MedvedevandGitHub 3c678df33f Update SECURITY.md 2025-03-17 10:10:42 +01:00
Anton Medvedev 6335202087 Update language-definition.md 2025-03-16 10:35:06 +01:00
Anton Medvedev e0c6fdc9b9 Code style: remove repeated helper functions 2025-03-15 16:41:40 +01:00
2pacandGitHub 0f20d93e5a chore: Added SOLO to the companies list (#769)
Signed-off-by: 2pac <[email protected]>
2025-03-13 14:10:14 +01:00
Anton Medvedev 8aaa33b16e Test for issue 756
Fixes #756
2025-03-10 15:00:21 +01:00
Anton Medvedev 31f0ab00dc Remove duplicated dereferences 2025-03-10 13:52:54 +01:00
Anton Medvedev 6022ffd21d Add support deref in all builtins 2025-03-10 13:38:02 +01:00
Anton Medvedev cd0943453d Remove print 2025-03-09 23:39:16 +01:00
Anton Medvedev 82ec7571df Correctly add OpDeref if needed
Fixes #739
2025-03-09 13:07:38 +01:00
Anton Medvedev ddbaa171c4 Add more tailing comma tests 2025-03-09 10:48:37 +01:00
18e2e03c5a Allow tailing comma in arguments (#623)
* feat: extract code for compiling equal operator

* feat: support last argument append with comma

---------

Co-authored-by: Anton Medvedev <[email protected]>
2025-03-09 10:45:17 +01:00
Anton Medvedev 80eb95bf5f Make sure get() returns nil for map[string]string on missing keys
Fixes #723
2025-03-08 17:28:39 +01:00
Anton Medvedev 41da963d55 Remove pointer accessor check in parser 2025-03-08 17:11:49 +01:00
Anton Medvedev 3fc6c1f535 Make all builtins working with deref
Fixes #730
2025-03-08 17:01:31 +01:00
Anton Medvedev 6c8437454d Update fuzz tests 2025-03-08 16:19:30 +01:00
Anton Medvedev 7e417b043e Add -update flag to gen tests 2025-03-08 15:40:47 +01:00
Anton Medvedev 8cab964afb Improve type checker for named types 2025-03-08 15:33:37 +01:00
Anton Medvedev 3d52b8e334 Fix func calls with nil types value
Fixes #688
2025-03-08 13:54:55 +01:00
Anton Medvedev 641966584f Make TestVM_ProfileOperations more robust 2025-03-08 13:49:10 +01:00
Anton Medvedev 5aada75b87 Add SequenceNode to compiler 2025-03-08 12:46:59 +01:00
Anton Medvedev 3a6c36ef12 Add SequenceNode to type checker 2025-03-08 12:36:18 +01:00
Anton Medvedev ebd5b4e426 Add print test for if 2025-03-08 12:31:51 +01:00
Anton Medvedev 26eebbe70c Better error message for predicate with sequence 2025-03-08 12:14:13 +01:00
Anton Medvedev 97e061adca Only allow if on precedence == 0 2025-03-08 12:02:09 +01:00
Anton Medvedev 2cff08a4a5 Refactor TestParse_error tests 2025-03-08 09:49:28 +01:00
Anton Medvedev c146c2fc9b Add SequenceNode
Fixes #717
2025-03-08 09:27:09 +01:00
Anton Medvedev 02dc5c04fc Properly check if interface is any
Fixes #744
2025-03-07 22:56:41 +01:00
Anton Medvedev dea75b14d8 Add more tests for filter_map optimization 2025-03-07 21:52:14 +01:00
Anton Medvedev 1e518fddcb Add ast.Find 2025-03-07 20:40:02 +01:00
Anton Medvedev 127f965eeb Do not optimize filter_map if #index used
Fixes #758
2025-03-07 20:39:53 +01:00
Anton Medvedev 454f913c95 Make len() return runes count for string
Fixes #746
2025-03-07 16:58:35 +01:00
Anton Medvedev e30c388fdf Add +build comments 2025-03-07 16:44:11 +01:00
45bc3f7595 refactor(conf): avoid type assertion in map case branch (#749)
Simplifies the code by using the type switch variable binding instead of
performing an additional type assertion.

Signed-off-by: Ville Vesilehto <[email protected]>
Co-authored-by: Anton Medvedev <[email protected]>
2025-03-07 16:42:00 +01:00
f1b80c01df Fix print with precedence (#678)
* feat: extract code for compiling equal operator

* fix: fix unary and binary node print

consider the precedence of operators and their associative law when printing unary and binary nodes

---------

Co-authored-by: Anton Medvedev <[email protected]>
2025-03-07 16:34:41 +01:00
Anton Medvedev e2f8470bd7 Add coverage.mjs comments 2025-03-07 16:24:24 +01:00
Anton Medvedev 13e0e4ac34 Exclude pro from go coverage.mjs 2025-03-07 15:56:31 +01:00
f99e1bad97 Separate patching phases for patchers that require multiple passes. (#659)
* Reset tracking of applied operator overloads before every walk of the ast tree.

* Remove limit on operator overload resolution

* Do separate patcher phase for those that require multiple passes (Currently only need for Operator overloading). This patcher phase is run after other patchers.

* Add test to track how many times a patcher is run. Used to detect if patching phases is erroneously applying the patcher multiple times.

---------

Co-authored-by: Anton Medvedev <[email protected]>
2025-03-07 15:27:19 +01:00
Anton Medvedev b42839dddb Remove additional run API (RunWithConfig) from VM
This API was introduced in previous PR, but we do not want to expose it.
2025-03-07 15:06:45 +01:00
9dd86858e1 feat: add node budget and memory limits (#762)
* feat: add node budget and memory limits

Implement compile-time and runtime safeguards against deeply nested expressions:

- Add MaxNodes limit to track and limit AST node count during parsing
- Move MemoryBudget from VM to Config for better configurability
- Add node creation tracking in parser to enforce node budget
- Refactor node creation to check limits before allocation
- Add RunWithConfig to VM for passing memory budget settings
- Set reasonable defaults in Config (10000 nodes, 1M memory)
- Add comprehensive tests for both node and memory limits

This prevents stack overflows from malicious or poorly written expressions
by failing fast with clear error messages during compilation or runtime.

Signed-off-by: Ville Vesilehto <[email protected]>

* Update parser.go

Signed-off-by: Anton Medvedev <[email protected]>

---------

Signed-off-by: Ville Vesilehto <[email protected]>
Signed-off-by: Anton Medvedev <[email protected]>
Co-authored-by: Anton Medvedev <[email protected]>
2025-03-07 14:09:41 +01:00