Commit Graph

913 Commits

Author SHA1 Message Date
microproofs
b1728b57b8 chore: Release 2023-04-28 17:11:56 -04:00
microproofs
7201163b77 fix: better function hoisting for code gen functions
mainly code gen function dependencies won't be hoisted to the top.
2023-04-28 17:05:46 -04:00
rvcas
baa2cef6c4 feat(playground): impl clone for some errors 2023-04-24 17:13:20 -04:00
microproofs
ff87a4c60f fix: "when bool is" was not properly assigning term to body when not a complex clause
Add some end to end tests to test uplc
2023-04-23 12:51:23 -04:00
microproofs
9bb1a88f23 fix: expect [] on a non-empty list now fails. 2023-04-21 17:39:21 -04:00
rvcas
c9a762a13c fix: we weren't including the name unused var warning 2023-04-20 16:53:56 -04:00
microproofs
c2ee631d07 feat: new setup for the gen_uplc testing
* new test only module aiken_project::tests
* move TestProject to tests/mod.rs
* new tests go in gen_uplc.rs
2023-04-19 16:08:55 -04:00
microproofs
e4276d7f5a move uplc tests to new location 2023-04-19 16:08:55 -04:00
microproofs
23a7e7e680 chore: convert acceptance test 5
Also constructors with no fields are now converted to a constant data term.
2023-04-19 16:08:55 -04:00
microproofs
7dd13f8d73 feat: add end to end tests to replace acceptance tests with strict uplc comparison.
Add acceptance tests 1,2, 6 as end to end tests
2023-04-19 16:08:55 -04:00
rvcas
3182dac908 chore: Release 2023-04-17 10:53:30 -04:00
rvcas
3b351d36fb fix(aiken-lang): assignment as last expr in when and if 2023-04-16 19:55:47 -04:00
rvcas
3d0fa1a5f6 chore: Release 2023-04-16 16:49:08 -04:00
rvcas
98c61ca151 feat(aiken-lang): anonymous functions
@MartinSchere noticed a weird error
where an unknown variable wasn't being reported
the type checker was incorrectly scoping
arguments for anonymous function definitions.
Luckily his compilation failed due to a FreeUnique
error during code gen which is good. But this may
have been the source of other mysterious FreeUnique
errors.

I also noticed that anonymous function allowed
arguments with the same name to be defined.

`fn(arg, arg)`

This now returns an error.
2023-04-16 16:38:43 -04:00
rvcas
63ddef7efb chore: Release 2023-04-13 13:37:12 -04:00
rvcas
12e8ebdf4f chore: revert version bumps 2023-04-13 13:03:43 -04:00
KtorZ
067e39286d Bump versions to 1.0.0-alpha, update CHANGELOG. 2023-04-13 17:35:21 +02:00
KtorZ
00550f8ddb Add myself as co-authors for some of the project's crate
Forgot to do it before, and noticing now :D
2023-04-13 17:25:21 +02:00
KtorZ
e2c78bdd3b Add min rust-version to crates
So that people runs into better errors if they try installing from source with an 'obsolete' rust compiler.
2023-04-13 17:24:44 +02:00
rvcas
70f12d3fc5 chore: new branch with some things from the bumpalo branch 2023-04-13 01:28:27 -04:00
microproofs
fc1b8738df fix: fixed how the ir was generating for expect Void, expect Bool, let Void
add some acceptance tests for the various scenarios
2023-04-12 22:37:33 -04:00
Kasey White
1e35281650 clause guard with discard is now handled 2023-04-12 08:26:03 +02:00
Kasey White
e69a70f49c remove final wrapper and replace with equivalent air elements 2023-04-09 17:43:56 -04:00
Kasey White
9e95e24624 now tests are passing 2023-04-09 17:43:56 -04:00
Kasey White
efb901f3b4 fix: issue with modifying a functions dependencies and adding a function that depended on it causing infinite loops 2023-04-09 17:43:56 -04:00
Kasey White
a17ebf301f fix: now we monomorphize __expect_type functions 2023-04-09 17:43:56 -04:00
Kasey White
9d9f8a914a fix generics causing a free unique due to ordering in expect_type 2023-04-09 17:43:56 -04:00
Kasey White
581c86ed83 chore: commented code removal 2023-04-09 17:43:56 -04:00
Kasey White
8d81345fb1 fix: diff_defined_types was not being filled if constructor had 0 args 2023-04-09 17:43:56 -04:00
Kasey White
f8483da4e0 Code gen now handles expecting on validator args in the air stack.
Thus allowing us to use code gen created functions to expect on data types including recursive ones.
Some minor tweaks to the air.
Added a uplc optimization for later.
2023-04-09 17:43:56 -04:00
Kasey White
4e4eed13e1 refactor define_ir_recurse to use let else 2023-04-09 17:43:56 -04:00
Kasey White
4ff0504d58 feat: change define_ir_processor to handle code_gen_functions
Also flattened out that function by using let else
2023-04-09 17:43:56 -04:00
Kasey White
bc7b07c1d9 fix: expect_type now works on recursice constructors and validator args are now handled by air 2023-04-09 17:43:56 -04:00
Kasey White
6c932bb562 expect on map and list now use a function that gets instantiated as air in code gen functions 2023-04-09 17:43:56 -04:00
Kasey White
abd97f0ade changed assert_on_list from being defined at uplc level to being defined at air level to enable proper hoisting 2023-04-09 17:43:56 -04:00
Kasey White
f4ba6b8985 fix: unused validator args had an incorrect if check 2023-04-09 17:43:56 -04:00
Kasey White
3f45b524b8 feat: unused validator args are not expect checked 2023-04-09 17:43:56 -04:00
Kasey White
8c8312a412 fix: expect true was always expecting false 2023-04-09 17:43:56 -04:00
Kasey White
ddf0fbfa0a fix: expect void now checks for unit instead of expecting data
Args in validator are now fully expected on.
Add new air FieldsEmpty to make checking for empty constructors easier
2023-04-09 17:43:56 -04:00
KtorZ
d620f6367c Bootstrap schema validation for simple constants. 2023-04-08 08:57:03 +02:00
rvcas
1444c9328d fix some typos 2023-04-07 16:51:18 -04:00
rvcas
d8cbcde61d feat(validators): unused param warning
Params being unused were being incorrectly reported.
This was because params need to be initialized
at a scope above both the validator functions. This
manifested when using a multi-validator where one of
the params was not used in both validators.

The easy fix was to add a field called
`is_validator_param` to `ArgName`. Then
when infering a function we don't initialize args
that are validator params. We now handle this
in a scope that is created before in the match branch for
validator in the `infer_definition` function. In there
we call `.in_new_scope` and initialize params for usage
detection.
2023-03-30 21:15:27 -04:00
Kasey White
8fad5b77c6 chore: add some unit tests to stack 2023-03-30 11:32:18 -04:00
KtorZ
6a4f62d074 Allow newlines in when clause sequences. 2023-03-30 13:49:00 +02:00
KtorZ
5d4c95d538 Supports commenting validator inner functions. 2023-03-30 13:37:09 +02:00
KtorZ
814157dd7b Fix formatter inconsistency with record spread patterns. 2023-03-30 13:02:20 +02:00
KtorZ
17431daaa4 Correctly nest multiline pipeline expressions. 2023-03-30 12:48:15 +02:00
KtorZ
cc18e7cff2 Fix formatting of function expressions with traces
Fixes #471
2023-03-30 09:21:46 +02:00
Kasey White
aa29636d50 fix: scope issue with ir_stack being incremented wrongly with assignment
Also fixed  scope of constructor tag and void in whens
2023-03-28 21:15:22 -04:00
rvcas
80f2fd746d test(gen_uplc::scope): more replace unit tests
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00