aiken/crates/aiken-lang/src/parser
KtorZ f307e214c3
Remove parse error on bytearray literals for trace, todo & error, parse as String instead.
This has been bothering me and the more I thought of it the more I
  disliked the idea of a warning. The rationale being that in this very
  context, there's absolutely no ambiguity. So it is only frustrating
  that the parser is even able to make the exact suggestion of what
  should be fixed, but still fails.

  I can imagine it is going to be very common for people to type:

  ```
  trace "foo"
  ```

  ...yet terribly frustrating if they have to remember each time that
  this should actually be a string. Because of the `trace`, `todo` and
  `error` keywords, we know exactly the surrounding context and what to
  expect here. So we can work it nicely.

  However, the formatter will re-format it to:

  ```
  trace @"foo"
  ```

  Just for the sake of remaining consistent with the type-system. This
  way, we still only manipulate `String` in the AST, but we conveniently
  parse a double-quote utf-8 literal when coupled with one of the
  specific keywords.

  I believe that's the best of both worlds.
2023-02-19 10:10:42 +01:00
..
error.rs Remove parse error on bytearray literals for trace, todo & error, parse as String instead. 2023-02-19 10:10:42 +01:00
extra.rs chore: make folder names match crate name 2022-12-21 18:11:07 -05:00
lexer.rs Use double-quotes for utf-8 bytearrays, and @"..." for string literals 2023-02-19 10:09:22 +01:00
token.rs Use double-quotes for utf-8 bytearrays, and @"..." for string literals 2023-02-19 10:09:22 +01:00