KtorZ
7abd76b6ad
Allow to trace expressions (and not only string literals)
...
This however enforces that the argument unifies to a `String`. So this
is more flexible than the previous form, but does fundamentally the
same thing.
Fixes #378 .
2023-02-15 21:07:56 +01:00
Kasey White
a24fc55993
Delay 2nd arg on trace in case it throws and prevents trace from printing
2023-02-15 03:06:58 -05:00
Kasey White
e15e725bfe
add one more test
2023-02-15 02:20:05 -05:00
Kasey White
5e5a9dd25f
quick fix for test 59
2023-02-15 02:20:05 -05:00
Kasey White
32b0200966
fixes: tuple clauses, zero args funcs, list clause named pattern
...
List Clauses patterns handle var cases
Fixed Tuple Clauses issue with last clause not being a tuple
Redid how zero arg functions and dependencies are handled. Tough one lol
2023-02-15 02:20:05 -05:00
Kasey White
b7fa57027a
scope is now properly handled in expect cases
2023-02-14 12:38:36 -05:00
Kasey White
765ceefd38
feat: add ability to downcast void to data
2023-02-12 18:56:38 -05:00
Kasey White
4c838defd1
fix issue with final clause producing clauseguard air
2023-02-12 18:43:11 -05:00
Kasey White
e9883adf12
fix: scope issue when using when with a function call subject
2023-02-12 18:43:11 -05:00
Kasey White
4b1015e0d4
change how expect works on lists and constructors
...
Add more coverage to acceptance test 40 on expect
2023-02-11 22:26:34 -05:00
KtorZ
b83a247ff7
Add slightly more informative note for list pattern on int.
2023-02-11 17:00:32 +01:00
KtorZ
2e8fd6e1c2
Remove patterns on 'String'
...
There's arguably no use case ever for that in the context of on-chain
Plutus. Strings are really just meant to be used for tracing. They
aren't meant to be manipulated as heavily as in classic programming
languages.
2023-02-11 16:57:14 +01:00
rvcas
c1d67e95e1
feat: fix errors and add tests for BigInt changes
2023-02-09 15:01:30 -05:00
rvcas
3f540c7c99
chore: rename assignment kind
2023-02-09 00:47:38 -05:00
Kasey White
076871492b
fix: unwrap used in a reachable place. Replaced with alternative option
2023-02-09 00:09:23 -05:00
Kasey White
9ae28aaa88
all nebula tests pass. Had one more fix on listaccessor to finish
2023-02-09 00:09:23 -05:00
Kasey White
986a6009f7
fix: Various fixes for FieldsExpose, ListAccessor, TupleAccessor
2023-02-09 00:09:23 -05:00
Kasey White
5d0c5d2a5b
remove a redundant type replacement in build_ir
2023-02-05 23:56:44 -05:00
rvcas
3ff927d30a
feat: reset the generator when generate finishes
2023-02-05 20:35:39 -05:00
Kasey White
f1b24a5f6d
fix: the following issues
...
fix conversion from inner opaque type for when and assignment
This fixes Clause being used in cases where ListClause or TupleClause should be used
Reset defined and zero arg functions between each code gen
Fixes for optimizations when encountering shadowed variables
2023-02-05 20:35:39 -05:00
Kasey White
c32a9d7b6f
commit working changes so far
2023-02-05 20:35:39 -05:00
Kasey White
4c8221e439
fix: add is data check to recursive_assert_tipo
2023-02-04 02:47:55 -05:00
Kasey White
86ca466807
feat: some code gen improvements
...
* fix assert on pattern Var
* fix tuple index unwrapping closes #334
* allow wrapping when casting with let
* allow wrapping when casting via function call
2023-02-04 02:33:10 -05:00
rvcas
ae42dc964a
fix: allow var and discard with data on right hand side
2023-02-02 01:16:53 -05:00
Kasey White
1843b7e73b
clippy fix and remove some prints
2023-02-01 23:49:33 -05:00
Kasey White
9dc2bac2c3
fix:minor optimization fixes
...
Unique only comparison for equals led to strange results
Fixed by interning in a different spot
2023-02-01 23:49:33 -05:00
Kasey White
fdf89b7326
implement optimizations
...
-Force usage on builtins
-Inline vars used once
-Lambdas that use a var as an arg
-Lambdas that use a const as an arg
2023-02-01 23:49:33 -05:00
rvcas
a365649360
chore: clippy autofix
2023-02-01 18:53:11 -05:00
rvcas
c8efe60843
feat: use Rc for more things, fib_iter runs almost 3 seconds faster now
2023-02-01 18:53:11 -05:00
KtorZ
22a1c1dfb4
Use IndexMap throughout
...
In an ideal world, I should have handlded that directly at the conflicting commit in the rebase, but this would have bubbled up through all commits... which I wasn't really quite keen on going through. So here's an extra ugly commit that comes and 'fix the rebase'.
2023-01-31 09:51:00 +01:00
KtorZ
5683d19a4c
Refactor build steps to generate blueprints instead
...
The blueprint is generated at the root of the repository and is
intended to be versioned with the rest. It acts as a business card
that contains many practical information. There's a variety of tools
we can then build on top of open-source contracts. And, quite
importantly, the blueprint is language-agnostic; it isn't specific to
Aiken. So it is really meant as an interop format within the
ecosystem.
2023-01-31 09:48:38 +01:00
rvcas
af67f41ead
fix: Air::Lam not real, probably meant Air::Let
2023-01-30 12:01:40 -05:00
Lucas
b653714c0c
Merge branch 'main' into when-clause-guards
2023-01-30 11:40:29 -05:00
Kasey White
0ea2be0e95
feat: Add codegen for handling clause guards
2023-01-30 05:11:27 -05:00
Kasey White
a638388747
Add more complex test 40.
...
Add assert for when constr index is given
2023-01-30 04:17:03 -05:00
Kasey White
afd040fda5
feat: Finish up assert feature
...
Better error reporing on NonFunctionalApplication Error
Refactor redundant code
Add handling of whens with one clause.
2023-01-29 05:21:55 -05:00
Kasey White
4c8089c28a
Assert now works for a variety of types.
...
Still some final work to finish and test. Things are good so far
2023-01-28 05:14:12 -05:00
Kasey White
60736b4a54
chore: Add error when type casting without annotation
...
Also implement and test most of assert. Finishing last few cases.
2023-01-28 02:40:53 -05:00
Kasey White
fc88028034
some refactoring and adding assert on lists
2023-01-27 05:02:19 -05:00
Kasey White
d4eec1fe79
chore: Add scaffolding for assert
2023-01-27 05:02:19 -05:00
Kasey White
38c24cca01
single clause when not yet implemented
2023-01-27 05:02:19 -05:00
Kasey White
1af1b6d898
finalize aiken ir with typing
2023-01-27 05:02:19 -05:00
Kasey White
e36f91c39c
fix: multiple list cases of the same length weren't being handled
2023-01-21 19:42:17 -05:00
Kasey White
e8fb386bdc
chore: Switch from hashmap and hashset to indexmap and indexset
2023-01-21 18:10:15 -05:00
Kasey White
52724ea0e0
feat: handle anon zero arg functions.
...
Test 045
2023-01-19 01:34:27 -05:00
Kasey White
71ae85a720
missing a condition check on when
2023-01-18 15:29:51 -05:00
Kasey White
d7e4aef4c5
feat: Add boolean conditions to when statements
2023-01-18 15:29:51 -05:00
Kasey White
33d902ba2a
feat: Now opaque types with one constr and one field are converted to inner field type
2023-01-17 08:44:28 -05:00
Kasey White
98d2cb5afc
in progress: working on taking special opaque types and converting them to their inner type
2023-01-17 08:44:28 -05:00
Kasey White
7b023911af
add assert and record
...
Record is a more efficient air for making records
Assert guarantees a custom is of a certain variant.
2023-01-13 13:50:27 -05:00