Commit Graph

320 Commits

Author SHA1 Message Date
Kasey White
4a7bbc23df fix: change in scope was applied in wrong place in pattern_ir for constr expect 2023-03-12 00:25:26 -05:00
Kasey White
f377d60085 ChooseData is now lazy with its branch arguments.
This enables calling the un_data builtins directly from choose_data args
2023-03-09 00:31:57 -05:00
KtorZ
dbef4474fa Add new acceptance scenario: 065
-> The provided Plutus code called 'error'.

  This scenario _could_ work if `choose_data` was lazy in its arguments.
  Which is a reasonable thing to expect from `choose_data`. Since we
  don't have any way to introduce on-demand lazyness in the language
  (and we are not looking for ways), we need to make a special case for
  `choose_data` which is a perfect (and singular) use case for it.
2023-03-09 00:31:57 -05:00
Kasey White
c85240cbed Fix exception when doing expect boolean = ..
Add new Air Assert Bool
Add acceptance test 76
2023-03-08 22:31:30 -05:00
Matthias Benkort
d8934b3d8d Merge pull request #421 from aiken-lang/monomorph-panic-fix
Functions with only a generic return weren't being properly monomorph…
2023-03-08 11:39:50 +01:00
Kasey White
89373c32e6 Functions with only a generic return weren't being properly monomorphized. Fixed that. 2023-03-08 10:31:05 +01:00
rvcas
f8545854fc feat: json output for uplc eval 2023-03-08 10:19:36 +01:00
KtorZ
7257c2d89e Small tweaks on the hello_world examples. 2023-03-08 09:47:08 +01:00
KtorZ
4ea50ca9ab Remove editor configuration file.
Editor configurations and other system-specific files aren't meant to
  be committed to public repository. This belongs to a dev environment
  and should be handled by developers themselves though local git
  configurations.
2023-03-08 09:42:03 +01:00
Jack Fraser
6ec37778d7 change var to utxo from lockOutRef 2023-03-07 19:15:03 -05:00
Jack Fraser
2cfa0aeda9 add missing types, update log descriptions, deno fmt 2023-03-07 19:15:03 -05:00
Jack Fraser
80afb5fc2d update cli documentation 2023-03-07 19:15:03 -05:00
Jack Fraser
6aa51213e4 add deno settings 2023-03-07 19:15:03 -05:00
rvcas
9b96f7bb2e chore: commit acceptance test plutus files 2023-03-06 13:26:36 -05:00
Kasey White
f230af436c fix: scope issue with expect and function calls
Add acceptance test 72
2023-03-03 01:00:35 -05:00
Kasey White
5779b77ccc fix: Had to also check for generic type in return of a function.
add check to prevent stack overflow error
Add panic to prevent any other occurrences of stack overflow
2023-03-02 21:49:20 -05:00
Kasey White
26b4156d5a remove comment 2023-03-02 21:49:20 -05:00
KtorZ
451d9d8493 Add new acceptance test scenario: 068
Stack overflow happening during code generation.
2023-03-02 21:49:20 -05:00
KtorZ
65c336cb82 Update blueprint outputs to reflect latest specification.
Schemas of datums, redeemers and parameters are now nested under a field 'schema'. This allows to define a field 'purpose' at the same level.
2023-03-02 17:17:27 +01:00
Kasey White
0c1c7da16f add accpetance test 71 2023-03-01 14:22:59 -05:00
Kasey White
665a8dec67 feat: add support for unconstr_data
-Builitins IR now acts like Record IR in terms of argument consumption
-UnConstrData returns as Pair(Data,Data) to conform with how pairs are treated behind the scenes.
2023-02-26 00:13:38 -05:00
KtorZ
81e072a14e Add new acceptance test scenario: 064
- Type mismatch expected 'data' got 'integer'
  - Type mismatch expected 'data' got 'list data'
2023-02-26 00:13:38 -05:00
KtorZ
c0230a811f Add 'plutusVersion' to blueprints. 2023-02-21 15:37:35 +01:00
Kasey White
70164282f8 fix: switch from unwrap to if let to allow boolean when
fix: test 67 fixed to take in ByteArray instead of string literal
2023-02-20 04:37:33 -05:00
Kasey White
87eb4ca3b4 feat: handle single constr when with multiple branches
Add case to acceptance test 40
Add special case for top level single constr in a when.
2023-02-20 02:46:46 -05:00
KtorZ
5132110d4b Fix acceptance tests to use new syntax. 2023-02-19 10:10:40 +01:00
Kasey
f3cdc05875 fix: the refactor on discharge value env (#393) 2023-02-18 20:49:29 -05:00
KtorZ
cd4ceb219c Remove complex and compound constants.
This is not supported by the code generation, so it's a bit of a lie
  to have them in the language in the first place. There's arguably not
  even any use for constant records, list and tuples to begin with. So
  this cleans this up everywhere for the sake of moving forward with the
  alpha release.

  This now reduces constants to:

  - Integer
  - ByteArray
  - String

  Anything else can be declared via a function anyway. We can revisit
  this choice later.... or not.
2023-02-17 17:31:15 +01:00
KtorZ
560c17d5aa Add new acceptance test scenario: 060
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/aiken-lang/src/builder.rs:1088:13
    ╰─▶ not yet implemented
  ```
2023-02-17 17:13:04 +01:00
KtorZ
f10e9e8977 Add new acceptance test scenario: 062
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/uplc/src/optimize.rs:16:68
    ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "tests_bar", unique: Unique(1) })
  ```
2023-02-17 11:25:41 +01:00
KtorZ
8fabfd112e Add new acceptance test scenario: 063 2023-02-16 20:29:41 -05:00
KtorZ
e7a61df1f3 Add new acceptance test scenario: 062
```
  Error:
    × Main thread panicked.
    ├─▶ at crates/uplc/src/optimize.rs:16:68
    ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "tests_bar", unique: Unique(1) })
  ```
2023-02-16 20:27:00 -05:00
Matthias Benkort
ec6baf3a6a Merge pull request #351 from aiken-lang/acceptance-test-054-pattern-match-on-list
Add new acceptance test scenario: 056
2023-02-16 10:01:56 +01:00
rvcas
d41e6942c6 test: fix acceptance tests 2023-02-16 00:05:55 -05:00
rvcas
a311531508 fix(cli): aiken address 2023-02-16 00:05:55 -05:00
rvcas
673b57b81c feat: get bluprint stuff compiling again 2023-02-16 00:05:55 -05:00
rvcas
a88a193383 fix: properly lex new token and adjust parsed spans 2023-02-16 00:05:55 -05:00
KtorZ
d26ff0298f Add new acceptance test scenario: 054.
**a**

  ```
  × Main thread panicked.
  ├─▶ at crates/uplc/src/optimize.rs:16:68
  ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "__other_clauses_delayed", unique: Unique(13) })
  ```

  **b**

  ```
  × Main thread panicked.
  ├─▶ at crates/aiken-lang/src/builder.rs:771:14
  ╰─▶ not yet implemented: Assign
  ```

  **c**

  ```
  × choice_4 failed
  help: ┍━ left ━━━━━━━━━━━━━┑
        │ (con data #d87a80) │
        ┕━━━━━━━━━━━━━━━━━━━━┙

        should be equal to

        ┍━ right ━━━━━━━━━━━━━━━━━━┑
        │ (con data #d8799f182aff) │
        ┕━━━━━━━━━━━━━━━━━━━━━━━━━━┙
  ```
2023-02-15 22:12:41 -05:00
KtorZ
808ff97c68 Preserve trace, error & todo formatting. 2023-02-15 23:19:07 +01:00
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
KtorZ
4e51e49fe6 Align context diagnostics to use similar syntax. 2023-02-15 17:26:26 +01:00
KtorZ
7251b2d01e Remove single-argument function call special-case in formatter
Not sure what this special case was trying to achieve, but it's not right. There's no need to handle function call with a single argument differently than the others.
2023-02-15 17:22:08 +01:00
KtorZ
47e77aa819 Add new context test for datums and reference scripts 2023-02-15 17:10:14 +01:00
KtorZ
6772e20d85 Replace withdrawals withdraw validator with always true validator. 2023-02-15 12:59:33 +01:00
KtorZ
b300cf38db Add new script context test scenario covering minting & values. 2023-02-15 12:49:56 +01:00
KtorZ
01c392836e Fix CI script + add script interactions. 2023-02-15 09:42:46 +01:00
KtorZ
e1c0c3986d Remove unused imports in 054. 2023-02-15 09:42:45 +01:00
Kasey White
e15e725bfe add one more test 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
KtorZ
23bf101e08 Add new acceptance test scenario: 058
Doesn't like var patterns in list pattern-matching

  ```
  Error:
    × Main thread panicked.
    ├─▶ at crates/aiken-lang/src/uplc.rs:770:29
    ╰─▶ internal error: entered unreachable code
  ```
2023-02-15 02:20:05 -05:00