Commit Graph

575 Commits

Author SHA1 Message Date
rvcas 7867793bcd feat: on fmt if label and name are the same only print one 2022-12-21 19:17:15 -05:00
rvcas 4c4e454ea3 feat: all function args are now labeled implicitly 2022-12-21 19:17:15 -05:00
rvcas 42204d2d71 chore: make folder names match crate name 2022-12-21 18:11:07 -05:00
rvcas 9028424a96 feat: rename Nil to Unit 2022-12-21 17:27:20 -05:00
rvcas 9df5005820 feat: add IData and BData builtins 2022-12-21 14:39:46 -05:00
rvcas 429126e38f feat: add trace 2022-12-21 14:39:46 -05:00
KtorZ 9068c89c00 Show trace logs as part of the test output when any.
```
  ┍━ test ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  │ PASS [mem: 6370, cpu: 2591822] trace_1
  │ ↳ is negative
  │ ↳ is non-negative
  ┕━━━━━━━━━ 1 tests | 1 passed | 0 failed
  ```
2022-12-21 14:39:46 -05:00
KtorZ 2fc14c7c1f Make box-drawing code more reusable
- Move it to 'pretty' module.
  - Have function work on colored strings titles and contents
2022-12-21 14:39:46 -05:00
KtorZ f26737ecb4 Remove the 'trace/try' keyword, use builtin.trace
I am not entirely sure what the intent was for that keyword, but
  nothing really matched between the parser, the formatter and the uplc
  code gen. I don't think there's any need for a keyword here, trace is
  already readily available from the builtins.
2022-12-21 14:39:46 -05:00
KtorZ 2aad1794a1
make dependencies optional in Aiken's manifest. 2022-12-21 14:32:40 +01:00
Matthias Benkort e6f4b378e1
Merge pull request #146 from aiken-lang/micah/file-errors
Raise more descriptive errors when the `aiken.toml` manifest is missing.
2022-12-21 11:05:02 +01:00
Micah Kendall bd816615d7
Display more descriptive error on missing manifest
Before:

  ```
  ❯ aiken check
  Error:
    × No such file or directory (os error 2)
  ```

  After:

  ```
  ❯ aiken check
  Error:
    × Missing 'aiken.toml' manifest in /Users/ktorz/Documents/Projects/aiken-lang/aiken
    help: Try running `aiken new <REPOSITORY/PROJECT>` to initialise a project with an example manifest.
  ```

  Co-authored-by: KtorZ <matthias.benkort@gmail.com>
2022-12-21 10:10:17 +01:00
KtorZ 28c907d9de
Fix acceptance 021: allow registering type aliases in any order.
This is the most intuitive thing I could come up with: since the
  problem is mainly due to the order in which we try declaring the
  aliases, then it suffices to simply try as much as we can, and retry
  on failure until there's no more failure.

  Note that it's important to detect cycles if we do such thing (which
  we can by noticing that a given iteration didn't make any progress).

  It works pretty well in the end and even allow us to define a new kind
  of type error should there be a cyclic definition.
2022-12-21 09:43:37 +01:00
KtorZ a3591cc7dc
Fix 'aiken new', now require project name in specific format. 2022-12-21 00:19:24 +01:00
rvcas 796ac28044 feat: change the printing a little 2022-12-20 16:32:31 -05:00
rvcas e34cbc8e7e feat: compile deps 2022-12-20 16:32:31 -05:00
rvcas b06bf610b7 feat: dep downloading now works 2022-12-20 16:32:31 -05:00
rvcas 6a0b1ce5c3 feat: start trying to use deps 2022-12-20 16:32:31 -05:00
rvcas 5bd2a9336c feat: tons of boilerplate for fetching packages 2022-12-20 16:32:31 -05:00
rvcas a6fd8f92a8 feat(deps): start laying out some types and functions 2022-12-20 16:32:31 -05:00
rvcas b3266fb837 chore: clippy warnings 2022-12-20 16:32:31 -05:00
Kasey White ac14512706 feat: fix nil equals nil, and fix funcs with discard params 2022-12-20 15:40:01 -05:00
Kasey White 9177267570 feat: test 24 passes
fixed issue with is_tuple in types
minor monomorphize change
2022-12-20 15:40:01 -05:00
Kasey White 17603e8cca checkpoint 2022-12-20 15:40:01 -05:00
Kasey White 43ff66cd01 all tests pass besides todo in 13, couple changes
Use more cost efficient recurse
Monomorphize needed to deal with function arg return types
bytearray variant added for variant names
2022-12-19 00:41:27 -05:00
KtorZ b6556e6739 Rework 'new' to not generate needless boilerplate
Instead, prints out a README with useful informations.
2022-12-19 00:41:27 -05:00
Kasey White 421e7148d0 zero arg functions now work: test 15 2022-12-19 00:41:27 -05:00
Kasey White 3a765ddef5 add better todo 2022-12-19 00:41:27 -05:00
KtorZ 529b3e87ff Rename builtin as 'verify_ed25519_signature'
It's best to keep builtin as-close-as possible to their standard name
  because they're hard to document. We can then leverage the prelude and
  the standard lib for convenient names.
2022-12-19 00:41:27 -05:00
KtorZ 44d72c046e Print files / tests as they're processed when --debug
This is because there's no proper way to catch panics in Rust, which
  makes it hard to know _which_ test did cause the panic when this
  happen. The stack trace gives little detail about this, but we can
  print this information before it happens -- making it easier to
  identify the culprit.
2022-12-19 00:41:27 -05:00
Kasey White eb386f4606 feat: Add nil support for test 19 2022-12-19 00:41:27 -05:00
Kasey White 5b908aaeb7 fix: fieldsexpose getting wrong generic id and not replacing type 2022-12-19 00:41:27 -05:00
Kasey White 47fae21af7 minor fix to monomorphize 2022-12-19 00:41:27 -05:00
Kasey White 2bce818110 chore: fix list insertion order, function insertion order,
and Inner function issues with variant
2022-12-19 00:41:27 -05:00
Kasey White e6c59dca2c cleanup if then else a bit 2022-12-19 00:41:27 -05:00
Kasey White eddd202253 tests 1 through 10 pass now, add negate 2022-12-19 00:41:27 -05:00
rvcas 841babae5c chore: clean some links up so they point to the new repo 2022-12-17 11:19:02 -05:00
KtorZ 1055e342b1
Tweak syntax-highlighting for better output. 2022-12-17 17:09:13 +01:00
KtorZ 202678e21e
Improve rendering of type-signatures in docs
- [x] Display function arguments using a newline-multiline strategy
    when the signature gets too long. For example:

    ```
    union_with
      ( left left: AssocList<key, value>
      , right right: AssocList<key, value>
      , with with: fn(key, value, value) -> value
      ) -> AssocList<key, value>
    ```

  - [x] Show type-aliases as type-aliases in signatures; provided
    they've been specified as type annotations. Otherwise, fallback to
    the inferred type.

  - [x] Do not show argument names in signatures, but show labels when
    they're present. This reflects more the original intent behind
    labels (which are meant as public-facing documentation).
2022-12-17 13:07:28 +01:00
KtorZ 579030db36
Highlight current module in the sidebar. 2022-12-17 12:13:51 +01:00
KtorZ a34d7d4dbb
Revert 71e71ff
Redundant with the `kind: ModuleKind` field already.
2022-12-17 11:54:39 +01:00
KtorZ 1178fa3f01
Add source repository to config & docs. 2022-12-17 04:11:54 +01:00
KtorZ a83900409b
Adjust docs theme to catppuccin
- light-mode uses catpuccin-latte
  - dark-mode uses catpuccin-mocha
2022-12-17 04:11:54 +01:00
KtorZ 5c0920d6bb
Factor out common module prefix when all modules are under a same namespace. 2022-12-17 02:38:04 +01:00
KtorZ 600c7747da
Do not show link to source.
This require slightly more work and has little benefits at this stage given that the sources are literally inlined in the docs.
2022-12-17 01:02:21 +01:00
KtorZ e7f729c61b
Define HighlightJS definition for Aiken. 2022-12-17 01:02:21 +01:00
KtorZ e1065e892a
Support module constants in docs. 2022-12-17 01:02:21 +01:00
KtorZ ac0d180c5c
Apply suggestions from clippy. 2022-12-17 01:02:21 +01:00
KtorZ 873bd85d8b
Implement modules' extra, to get function & module comments in docs. 2022-12-17 01:02:21 +01:00
KtorZ 536c9457b3
Refactor project source parsing
There was already a 'parse_sources' function, and 'parse' was actually more about typechecking than parsing.
2022-12-17 01:02:21 +01:00