Skip to content

Changes

Started 2 mo 9 days ago
Took 13 min
Add __cast__ function and syntax

Add `__cast__(val, type)` function and syntax. Syntax is `(type) val`.
(commit: 19d690c)
Pieter12345 at
Warn on casts to same type + Error on impossible casts
(commit: e2698cc)
Pieter12345 at
Optimize __cast__()

- Mark `__cast__()` for constant and cached returns.
- Remove nested casts where the second executed cast is removed if the first executed cast passing ensures that the second executed cast will pass.
(commit: c530cec)
Pieter12345 at
Fix unknown Target for sugared __cast__() syntax
(commit: 99f21b3)
Pieter12345 at
Clone IVariables in IVariableList clone

Allows for not recreating a new `IVariable` for every assign operation.
(commit: 541100b)
Pieter12345 at
Reduce assign() runtime actions

- Do not redefine variables in variable list when not necessary.
- Unwrap IVariable values only once.
- Directly create new IVariable with correct values when necessary.
(commit: e017fc2)
Pieter12345 at
Fix compile error on post-assign non-cast parenthesis

Fixes compile error in the following example code:
```
@a = (1 + 2)
msg(123)
```
(commit: bd0a1fe)
Pieter12345 at
Add cast to operators table in documentation
(commit: 8ee2774)
Pieter12345 at
Rewrite proc parameter execution

Fixes issue where variables in default parameter value expressions resolve to previous parameters instead of variables from the outer scope in runtime.
(commit: 4f3dbd9)
Pieter12345 at
Fix syntax mistake in SignatureBuilder.varParam() docs
(commit: c4bc341)
Pieter12345 at
Fix missing default value in untyped parameter declarations

Only affects static analysis.
(commit: 9ecb896)
Pieter12345 at
Fix core errors in throw(type, string) with invalid type

Fix core errors in `throw(type, string)` when passing non-exception types.
(commit: c6af4a4)
Pieter12345 at
Fix forward declaration procedure parsing

- Fix forward declaration procedures not parsing correctly if they are not followed by an AST term. This seems to only be an issue in interpreter mode as far as was tested.
- Add comments to clarify proc keyword rewriting logic.
(commit: 507e0f0)
Pieter12345 at
Fix checking functions too early during compile

Caused a compile error when a function did not exist but was inside a proper function_exists() or extension_exists() code block.
(commit: 983b153)
PseudoKnight at