Commit Graph

1481 Commits

Author SHA1 Message Date
rvcas
d0d482b3cb chore(gift_card): run fmt 2023-04-07 16:35:58 -04:00
rvcas
4e380012fb chore(gift_card): use kupmios backed by demeter for lucid 2023-04-06 21:35:08 -04:00
KtorZ
057102c491 Add function to uplc::parser for string escape
Was originally written as a way to fix a failing property test on the
  program_builder; but the program builder is now gone. This function
  is still useful to have around.
2023-04-05 14:27:20 +02:00
waalge
cdff149b5e update flake 2023-04-03 11:22:27 -04:00
rvcas
298e8068ee chore: remove program_builder 2023-03-30 21:15:27 -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
cb5dc75326 Remove unnecessary import. 2023-03-30 11:50:59 +02:00
KtorZ
1d3315005c Support some single-character escape sequences in UPLC
Fixes #472.

  This also partially addresses #195. However, as pointed out in one of
  the comment, there's no 'official rule' when it comes to what should
  be considered valid escape sequences. Haskell relies mostly on the
  AttoParsec library and Rust also has its own set of rules.

  This is in particular true for unicode escape sequences, but there is
  a common middleground for some usual single character escapes such as
  \n or \\. So we now at least support these.

  For more complicated escape sequence, please refer to #195 for now and
  keep the discussion going there.
2023-03-30 11:50:59 +02:00
Matthias Benkort
9a8e17020b Merge pull request #475 from aiken-lang/patch/cargo.nix
Update Cargo.nix
2023-03-30 09:55:36 +02:00
KtorZ
30dc561853 [create-pull-request] automated change 2023-03-30 07:24:37 +00:00
KtorZ
dc500b8e13 Add missing import to owo_colors 2023-03-30 09:21:59 +02:00
KtorZ
cc18e7cff2 Fix formatting of function expressions with traces
Fixes #471
2023-03-30 09:21:46 +02:00
KtorZ
efa31e3df7 minor lsp tweaks
- forcibly disable colors
  - do not show labels in error messages
2023-03-29 18:25:56 +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
rvcas
e5980c5a96 feat(gen_uplc::scope): use some assumptions to simplify replace 2023-03-27 20:00:32 -04:00
Kasey White
c8ac9aa165 test: add replace same value unit test 2023-03-27 20:00:32 -04:00
rvcas
5453572fc0 test(gen_uplc::scope): common ancestor method
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
177c36fc68 chore: cargo audit is being stubborn again 2023-03-27 20:00:32 -04:00
Kasey White
822bb4242a fix: function hoisting errors --
One involving zero args being hoisted instead of compiled and replaced.
Second involving not updating a function's dependeny function scope. Which then hoisted to a lower scope and caused free unique
2023-03-27 20:00:32 -04:00
rvcas
703429af98 chore: commit plutus.json 2023-03-27 20:00:32 -04:00
rvcas
96b7fb1c50 chore: make clippy happy 2023-03-27 20:00:32 -04:00
rvcas
b5ed958f62 chore: remove unused variable 2023-03-27 20:00:32 -04:00
Kasey White
b2dcb112c9 fix last 2 acceptance tests 2023-03-27 20:00:32 -04:00
Kasey White
51a6589aac 2 acceptance tests left to fix 2023-03-27 20:00:32 -04:00
Kasey White
eef34b8f4b feat: all compiler errors fixed
Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-03-27 20:00:32 -04:00
Kasey White
25ff8acb1e feat: one more function to finish up 2023-03-27 20:00:32 -04:00
Kasey White
77afa76163 feat: refactor handle_each_clause
fix expect type ordering on constr type checking
2023-03-27 20:00:32 -04:00
rvcas
f07a959ab8 feat: almost done
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
709ee914ed feat: another round of functions using AirStack
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
489dd235ff feat(gen_uplc): finished up a few more functions
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
33a3c5dc13 feat(gen_uplc): introduce scope new type
* new module scope which holds some ancestor logic
* rework some things to truly hide scope increments

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
ca0d896b8d feat: start using AirStack methods
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
rvcas
3e6f688e2d feat: refactor some methods and modules
* move uplc::ast::builder to uplc::builder
* rename aiken_lang::uplc to aiken_lang::gen_uplc
* move aiken_lang::air and aiken_lang::builder to aiken_lang::gen_uplc
  as submodules

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
Kasey White
2d77ec1a6a add merge function 2023-03-27 20:00:32 -04:00
Kasey White
32d34d5fd3 create struct Air Env
refactor out some to_strings
2023-03-27 20:00:32 -04:00
rvcas
0060d29265 chore: update gift card example to use new validator syntax 2023-03-27 13:39:34 -04:00
Kasey White
bb820ebdd8 fix: trace and scope issues
fix scope issues involving fieldsexpose and other destructureing pattern
fix trace to extract string from term.
2023-03-21 12:38:13 -04:00
Matthias Benkort
77f58cf5cb Merge pull request #463 from waalge/main
bump rustc version for nix
2023-03-21 13:00:58 +01:00
waalge
8be95e6961 bump rustc version 2023-03-21 11:38:07 +00:00
Kasey White
6e5b24a937 refactor the rest of the term builders to use more concise code 2023-03-21 00:50:13 -04:00
Kasey White
7c3750bbb4 fix: apply order on field expose 2023-03-21 00:50:13 -04:00
Kasey White
50db958d06 update codegen to use more streamlined uplc building methods 2023-03-21 00:50:13 -04:00
Kasey White
ef3862ade8 refactor: uplc code gen uses shorthand methods 2023-03-21 00:50:13 -04:00
Kasey White
74a7a2f214 commit air changes that expose scope as a mutable pointer 2023-03-21 00:50:13 -04:00