Commit Graph

2881 Commits

Author SHA1 Message Date
Riley-Kilgore
cab58e5aab One other place 2024-08-12 17:57:54 -04:00
Riley-Kilgore
213ad48de7 Fixed span calculation for backpassing (sort of) 2024-08-12 17:57:54 -04:00
Matthias Benkort
eb4a43719c Merge pull request #998 from aiken-lang/riley/misc-hover
Added more granularity to find_node for Fn
2024-08-12 02:16:38 +02:00
Matthias Benkort
3b94717c58 Merge pull request #996 from aiken-lang/acceptance-scenario-108
Illustrate new failing scenario with multi-arg function identifiers
2024-08-10 16:05:01 +02:00
Riley-Kilgore
52c8ca6cee Added fix to Fn find_node 2024-08-08 17:15:28 -07:00
microproofs
72059eacee Fix: Recursion issue where the static param optimization on recursive functions that were passed as arguments to other functions 2024-08-08 19:36:16 -04:00
KtorZ
6e4a16d8e0 Illustrate new failing scenario with multi-arg function identifiers
As far as I could tell, this behavior is only observed when the arity
  of the function is higher than 1. It's fine for single-arg functions
  somehow.
2024-08-08 14:52:19 -04:00
KtorZ
59bc9e04ad Box large elements in project errors. 2024-08-08 14:52:19 -04:00
KtorZ
b36250d183 Provide better errors on unknown type in cyclic definitions.
Let's consider the following case:

  ```
  type Var =
    Integer

  type Vars =
    List<Var>
  ```

  This incorrectly reports an infinite cycle; due to the inability to
  properly type-check `Var` which is also a dependent var of `Vars`. Yet
  the real issue here being that `Integer` is an unknown type.

  This commit also upgrades miette to 7.2.0, so that we can also display
  a better error output when the problem is actually a cycle.
2024-08-08 14:52:14 -04:00
microproofs
6fd9b34b92 Running examples as doc tests is not gonna work 2024-08-08 00:39:44 -04:00
microproofs
53c461294b Fix example that was throwing an error 2024-08-08 00:39:44 -04:00
microproofs
31627897d7 Fix example that was throwing an error 2024-08-08 00:39:44 -04:00
microproofs
0800901135 Fix clippy 2024-08-08 00:39:44 -04:00
microproofs
51fd503317 warning fix 2024-08-08 00:39:44 -04:00
microproofs
0a1992acd2 Run acceptance tests 2024-08-08 00:39:44 -04:00
microproofs
224f31b1d7 Fixed last gen_uplc test 2024-08-08 00:39:44 -04:00
microproofs
56ff4ec678 Fixing other tests 2024-08-08 00:39:44 -04:00
microproofs
7ad5491ea9 Fix major uplc test 2024-08-08 00:39:44 -04:00
microproofs
33370b8637 Fix minor issues found when testing 2024-08-08 00:39:44 -04:00
microproofs
4249ef2509 Fix extra delay in a test 2024-08-08 00:39:44 -04:00
KtorZ
f5c4e185d4 Redact compiledCode & hash in generated blueprint tests
The point of those tests is to ensure that blueprints are generated
  properly, irrespective of the generated code. It is annoying to
  constantly get those test failing every time we introduce an
  optimization or something that would slightly change the generated
  UPLC.
2024-08-08 00:39:44 -04:00
microproofs
8a461d5bd5 Few minor changes, clippy fixes, and test fixes 2024-08-08 00:39:44 -04:00
microproofs
4cf81a19b1 Update most of the tests and builder functions to use the new delay_branch_functions 2024-08-08 00:39:44 -04:00
microproofs
d7e9fef4d3 Create new helper functions to take care of force and delaying branch terms 2024-08-08 00:39:44 -04:00
KtorZ
23a3134642 Rework choose_data_xxx API to include force/delay inside functions. 2024-08-08 00:39:44 -04:00
microproofs
d23a5b2f11 Fix test for expect_head_cast_data_with_tail 2024-08-08 00:39:44 -04:00
KtorZ
8b30f064a2 Make gen_uplc test output more readable + start debugging expect_head_cast_with_tail 2024-08-08 00:39:44 -04:00
KtorZ
021679b8ac Force unwrap_xxx_or inside function body
Otherwise, it becomes the responsibility of the caller to force the result; which may be easily forgotten.
2024-08-08 00:39:44 -04:00
microproofs
a132a2e486 Fix unwrap issues 2024-08-08 00:39:44 -04:00
KtorZ
93a141bfa4 Test and fix 'unwrap_void_or' 2024-08-08 00:39:44 -04:00
KtorZ
49ddcccd12 Revert checking for negative constr on bool
It is impossible to serialize/deserialize a Data with a negative
  constructor. So the only way this can happen is by programmatically
  construct a value using builtin constr_data.

  While possible, it is entirely at the responsibility of the
  programmer, but not malleable from an attacker who can only provide
  values as 'Data' (and thus, must be decoded like others).
2024-08-08 00:39:44 -04:00
KtorZ
aefbc6e1b9 Define a safer API for unwrap_xxx_or and choose_data_xxx
Cloning a 'Term' is potentially dangerous, so we don't want this to
  happen by mistake. So instead, we pass in var names and turn them into
  terms when necessary.
2024-08-08 00:39:44 -04:00
KtorZ
846c16087e Test (and fix) unwrap_or helpers. 2024-08-08 00:39:44 -04:00
KtorZ
ea8003af8f Fix bool soft-casting.
While the ledger doesn't allow deserializing negative constr value,
  they are still possible at the machine level. So, we better make sure
  that we don't make assumptions regarding this.
2024-08-08 00:39:44 -04:00
KtorZ
9610237616 Refactor unknown_data_to_type, break down into smaller functions. 2024-08-08 00:39:44 -04:00
KtorZ
c3a61706b5 Factor out common UPLC logic for converting Data to Bool. 2024-08-08 00:39:44 -04:00
microproofs
05504b9762 Fix out of order expect check. Also fix no_inline error in code gen. @acceptance_107 2024-08-08 00:39:44 -04:00
microproofs
663695558c Fix remaining errors and now onto testing 2024-08-08 00:39:44 -04:00
microproofs
0be5229f1c Only 2 errors and todos left to finish 2024-08-08 00:39:44 -04:00
microproofs
6ba9a312f0 Work through all but constr case for expect_type_assign
TODO: constr case for expect_type_assign
TODO: soft_cast opcode uplc codegen
TODO: fix PairAccessor opcode uplc codegen
2024-08-08 00:39:44 -04:00
microproofs
dd5badd884 Start work on revamping assignment so we can handle soft casting properly 2024-08-08 00:39:44 -04:00
KtorZ
9ea54afd12 Add on more example illustrating if/is issue. 2024-08-08 00:39:44 -04:00
KtorZ
a6c5dbb5ad Thread down if/is pattern assignment type down to code-generation.
This isn't sufficient however, as the 'assignment' helper handling
  code generation doesn't perform any check when patterns are vars. This
  is curious, and need to be investigated further.
2024-08-08 00:39:44 -04:00
KtorZ
c4abf2e8f4 Add acceptance test 106 showing issue with if/is implicit casting. 2024-08-08 00:39:44 -04:00
KtorZ
aa872846bb Re-generate insta snapshots, remove obsolete snapshots. 2024-08-06 19:25:35 +02:00
KtorZ
9d8fdf787c Improve formatter on long-lines, in particular bin-ops. 2024-08-06 19:25:35 +02:00
KtorZ
91e0e2493a Provide better errors on unknown type in cyclic definitions.
Let's consider the following case:

  ```
  type Var =
    Integer

  type Vars =
    List<Var>
  ```

  This incorrectly reports an infinite cycle; due to the inability to
  properly type-check `Var` which is also a dependent var of `Vars`. Yet
  the real issue here being that `Integer` is an unknown type.

  This commit also upgrades miette to 7.2.0, so that we can also display
  a better error output when the problem is actually a cycle.
2024-08-06 19:24:48 +02:00
KtorZ
1ae6640cd0 Make alternative clause parser more flexible.
The spirit here is to make it easier to discover this syntax. People
  have different intuition about it and the single pipe may not be the
  most obvious one.

  It is however the recommended syntax, and the formatter will rewrite
  any of the other to it.
2024-08-06 11:31:11 +02:00
KtorZ
8c121f6d97 Document 'export' and provide better errors on module not found. 2024-08-06 11:09:05 +02:00
KtorZ
e3b1cf1093 Rework CHANGELOG to reflect reality.
We never released 1.0.30, so it's a bit misleading to have an entry for it in the CHANGELOG. So I merged its content with the ongoing release which is likely to be 1.1.0
2024-08-06 10:50:15 +02:00