Commit Graph

117 Commits

Author SHA1 Message Date
Ayaz Hafiz
aab509c5c1
Make sure to escape formatting of char literals
Closes #4682
2022-12-05 14:09:28 -06:00
Joshua Warner
2b91af02df
Introduce record! combinator
... and refactor header parser to fully use combinators, in support of future combinator-based superpowers
2022-11-28 20:25:55 -08:00
Ayaz Hafiz
1011ce9fba
Format crash 2022-11-24 14:46:49 -06:00
Ayaz
848c18f996
Merge pull request #4567 from joshuawarner32/tuple-type-annotation
Implement tuple type parsing
2022-11-24 14:42:11 -06:00
Joshua Warner
c6b5273144
Implement tuple type parsing
Also change some tests with newly relaxed indentation requirements, and remove an irrelevant test (since unindented close parens are now perfectly valid, the test is no longer useful).
2022-11-24 07:36:59 -08:00
Folkert
e44a8a9eed
print all the relevant info 2022-11-23 22:58:58 +01:00
Richard Feldman
49f8768271
Parse and format dbg 2022-11-22 21:08:26 -05:00
Folkert de Vries
0920fb4227
Merge pull request #4508 from roc-lang/windows-final-cli-tests
Windows final cli tests
2022-11-16 18:21:49 +01:00
Anton-4
5a447a9fcc
Merge branch 'main' of https://github.com/roc-lang/roc into windows-final-cli-tests 2022-11-16 13:58:17 +01:00
Anton-4
b681949461
clippy+fmt 2022-11-16 13:55:58 +01:00
Anton-4
e9d8d13b02
windows fixes, error improvements 2022-11-16 13:55:58 +01:00
Joshua Warner
d4bf946327
Assert formatting for parse tests 2022-11-15 19:47:28 -05:00
Joshua Warner
1efd7260de
Add fmt test to make sure formatting works for all parser test cases 2022-11-14 08:20:35 -05:00
Joshua Warner
ca5d084497
Implement tuple pattern parsing
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00
Folkert
662bf1de99
more workspace dependencies 2022-11-13 16:10:02 +01:00
Joshua Warner
f4ce4bf983
Implement parsing for tuple accessor functions (.1, .2, etc)
Step 2 of N toward implementing #4465
2022-11-12 09:56:29 -05:00
Richard Feldman
83e4eef475
Merge pull request #4492 from joshuawarner32/tuple-syntax-1
Implement initial tuple syntax
2022-11-11 17:55:25 -08:00
Joshua Warner
6c15cc750f
Change test to use single backpassing instead of multi 2022-11-11 08:13:13 -05:00
Joshua Warner
1753c9cf5b
Implement initial tuple syntax 2022-11-08 18:04:46 -05:00
Luke Boswell
2c2a70b8e7 Merge remote-tracking branch 'upstream/main' into rust-docs 2022-11-06 09:15:57 +11:00
Folkert
134de80150
various updates 2022-11-03 17:18:27 +01:00
Folkert
66a1ba00eb
1.65 clippy fixes 2022-11-03 16:20:37 +01:00
Luke Boswell
f3bdb5f321
updating rust package documentation 2022-11-03 20:00:06 +11:00
Richard Feldman
50d9755758
Merge pull request #4429 from austinclem1/main
add missing indent when formatting single-quoted char in pattern
2022-10-31 17:56:06 -07:00
Joshua Warner
07be8ec000
Refactor Parser trait to pass min_indent
This removes the need to explicitly pass thru min_indent when using the parser combinators.

My ultimate goal here is to evolve the current parser closer toward a purely combinator-based parser,
at which point we can more easily transition smoothly to a formal(ish) grammar, or expand the meanings of combinators
to include things like:
* Incremental (re)parsing
* Unified parsing and formatting code
* Better error recovery
* Using the main parser directly for syntax highlighting
2022-10-31 13:31:47 -07:00
Austin Clements
5d19d28e56 formatting 2022-10-28 18:13:03 -05:00
Austin Clements
ec81ce5ebc add test for formatter: single-quoted char pattern 2022-10-28 16:36:24 -05:00
Austin Clements
87041f8cd7 add missing indent when formatting single-quoted char in pattern 2022-10-28 14:49:50 -05:00
Ayaz Hafiz
9bb523ce97
Format list patterns 2022-10-26 17:08:10 -05:00
Ayaz Hafiz
4d35ab9957
Parse list patterns 2022-10-26 17:03:22 -05:00
Ayaz Hafiz
1053c11907
Basic formatting of multi-abilities 2022-10-24 14:00:46 -05:00
Ayaz Hafiz
548a235c25
Support parsing multiple abilities in a clause 2022-10-24 13:56:06 -05:00
Joshua Warner
e39a385f5f
Allow parsing when cases with python-like indentation 2022-10-18 19:13:20 -07:00
Ayaz Hafiz
df3b7cb1b4
Preserve comments before header
Closes #4212
2022-10-05 08:34:30 -05:00
Ayaz Hafiz
f6c21cc933
Correctly format abilities with comments 2022-10-04 10:03:51 -05:00
Ayaz Hafiz
bbb2083dd6
Correctly format nested pipeline operators
Closes #4151
2022-10-03 14:18:17 -05:00
Ayaz Hafiz
3883867b5c
Properly format characters with escape sequences
Ran into this just now
2022-10-02 17:10:34 -05:00
Ayaz Hafiz
6a83babaf3
Don't write extra newline if it's already there 2022-09-14 11:26:52 -05:00
Ayaz Hafiz
31b894d027
Remove region when normalizing expects 2022-09-14 11:26:48 -05:00
dependabot[bot]
0079048944
Bump bumpalo from 3.10.0 to 3.11.0
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.10.0...3.11.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:56 +00:00
dependabot[bot]
d1c406812f
Bump pretty_assertions from 1.2.1 to 1.3.0
Bumps [pretty_assertions](https://github.com/rust-pretty-assertions/rust-pretty-assertions) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/rust-pretty-assertions/rust-pretty-assertions/releases)
- [Changelog](https://github.com/rust-pretty-assertions/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-pretty-assertions/rust-pretty-assertions/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: pretty_assertions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 05:28:00 +00:00
Richard Feldman
be0c098b76
Revert "Always put the | in a has clause on a new line"
This reverts commit fd2ef1a3ce.
2022-09-11 20:25:15 -04:00
Richard Feldman
5d7213aa7d
Removed an || condition that was always false 2022-09-11 20:19:22 -04:00
Richard Feldman
fd2ef1a3ce
Always put the | in a has clause on a new line 2022-09-11 20:19:11 -04:00
Richard Feldman
8e6abc8079
Clean up some formatter logic 2022-09-11 20:18:40 -04:00
Ayaz Hafiz
fc6561ecb6
Format string literals in patterns 2022-09-07 17:30:52 -05:00
raleng
85eda83398
Enable and add multi-line string formatting tests 2022-08-26 12:19:14 +02:00
raleng
1c8bc7d969
Fix formatting block string containing quotes
Single-line block strings are parsed as PlainLines. When the string
contains quotes, this leads to invalid formatted strings. This commit
special cases strings containing quotes the same as strings containing
newlines and formats them to multiple lines using triple-quotes.
2022-08-26 11:36:54 +02:00
raleng
4991adb05b
Fix multiline string formatting
This change adds the proper indentation when formatting multiline
strings to not end up with invalid code. This also make sure that
multiline strings are always formatted using multiple lines, regardless
of the string literal itself contains a newline.
2022-08-26 11:13:37 +02:00
raleng
1b2952bc70
Fix invalid multiline string output in REPL
If a PlainLine string contains a newline character, the REPL will print
the string using a triple-quoted block string.
2022-08-23 11:26:48 +02:00