Ayaz Hafiz
a3ac68a41f
Split up Defs into TypeDef and ValueDef
...
Just a refactoring PR. This is useful because during canonicalization
we always process type defs first, then value defs. With abilities this
distinction continues to grow; in that case, we have patterns associated
with types that we want to process before patterns from values.
2022-04-06 22:18:57 -04:00
Ayaz Hafiz
eee19bba2b
s/demands/members
2022-04-06 11:34:55 -04:00
Pierre-Henri Trivier
3e368a64ff
Formatter should ignore non roc files
...
Fixes #2683
2022-03-17 18:55:15 +01:00
ayazhafiz
d7abc3897b
Parse abilities
2022-03-12 21:29:06 -06:00
Richard Feldman
8f6f20b57d
Avoid reallocation when ensuring trailing newline
2022-03-06 11:12:43 -05:00
Philippe Vinchon
813845e7d1
Trim end and add empty line for POSIX
2022-03-05 22:31:57 +00:00
Brendan Hansknecht
cd0d89fdc9
Merge remote-tracking branch 'origin/trunk' into single-quote-literal
2022-02-25 07:39:58 -08:00
celso
98eb359dad
fixes identation on flatten_directories
...
Co-authored-by: hafiz <20735482+ayazhafiz@users.noreply.github.com>
2022-02-24 20:07:03 -03:00
Celso Bonutti
98f3f14984
fixes compiling error on directory flattening
2022-02-24 20:00:29 -03:00
Celso Bonutti
36dffc8c5f
changes implementation of folder flattening
2022-02-24 19:58:20 -03:00
Celso Bonutti
214d4e025b
changes wording from 'folder' to 'directory'
2022-02-24 18:10:39 -03:00
Celso Bonutti
797605cd72
uses the word 'folder' consistently
2022-02-24 17:56:48 -03:00
Celso Bonutti
8bafbf3beb
extracts .roc files from folders before formatting
2022-02-24 17:33:53 -03:00
Brendan Hansknecht
f7c0e2ef19
Merge remote-tracking branch 'origin/trunk' into single-quote-literal
2022-02-24 10:13:39 -08:00
ayazhafiz
6104a27b45
Parse opaque references
2022-02-19 21:30:42 -05:00
ayazhafiz
fa24e51593
Parse opaque types
2022-02-19 18:38:31 -05:00
ayazhafiz
8ce81e4607
AliasHeader -> TypeHeader
2022-02-19 17:51:56 -05:00
Ryan Olson
60b5465de2
Add --check flag for format command
...
Closes #2495
2022-02-16 12:44:30 -07:00
Folkert
6ebdc17165
formatting
2022-02-04 00:06:50 +01:00
Folkert
885500712c
remove old Effect module things
2022-02-03 23:55:02 +01:00
Richard Feldman
c3123de737
format hosted modules
2022-01-30 20:40:49 -05:00
Folkert
5580eafb68
Merge remote-tracking branch 'origin/trunk' into tea-example
2022-01-25 09:20:59 +01:00
Mats Sigge
71f359fbdc
Move macros from roc_reporting to new roc_error_macros module
...
The `internal_error!` and `user_error!´ macros can't be used everywhere
when they live in `roc_reporting` due to circular dependencies.
2022-01-23 18:40:04 +01:00
Folkert
6545968c34
import UserApp's provided types into the Package-Config module
2022-01-23 18:33:50 +01:00
Richard Feldman
c1c0ffb25f
Use UppercaseIdent over PlatformRigids
2022-01-23 11:13:23 -05:00
Joshua Warner
8092f31a29
fmt
2022-01-01 18:20:05 -08:00
Joshua Warner
5c1084c453
Introduce SourceError to represent an error + original source
2022-01-01 18:20:05 -08:00
Joshua Warner
bd7b1e5013
Make Loc::new take Positions
2022-01-01 18:20:05 -08:00
ayazhafiz
966198a6e7
Coalesce inline and normal alias headers
...
Unifies `As` annotations and `Alias` defs to use a common struct for
defining alias header information, i.e. the name and type variables of
the alias.
2021-12-26 09:37:56 -06:00
ayazhafiz
2cd5bf8c03
Parse "as" aliases into tag/args rather than arbitrary annotations
2021-12-26 08:44:09 -06:00
Joshua Warner
8b58d5cbc7
Switch to always encoding package names / paths as strings
...
This will simplify parsing and make it possible to have a uniform lexer for the language. Previously unquoted package names were allowed to include '-'s, which aren't valid identifiers.
In the future, we'll distinguish local paths from packages in the package-manager by looking for a ".roc" suffix, which should only be present in local paths.
2021-12-23 20:11:14 -08:00
Joshua Warner
f19220473a
Rename Located -> Loc
2021-12-22 19:18:22 -08:00
Joshua Warner
49818343dd
extract state
2021-12-16 17:13:53 -08:00
Joshua Warner
0786e554c6
Extract spacing from parse::header::* items into explicit Spaced enum
2021-12-14 19:53:20 -08:00
Joshua Warner
e3f2f8d9a4
keep indent state in fmt Buf
2021-12-04 18:26:32 -08:00
Joshua Warner
270cc49867
Also check formatting is stable in tests; ignore a test that's invalid / incorrect
2021-12-02 17:46:50 -08:00
Joshua Warner
595ce5e81a
Check that formatting is stable before writing the result to a file
2021-12-02 17:17:56 -08:00
Chelsea Troy
0e5f82526a
Account for SingleQuote in the case statements for the cli, plus some errata
...
+ Evidently I failed to finish fixing merge conflicts
+ Some of the types that the SingleQuote code mentioned didn't exist according to the build step. I looked around and switched them out for types it LOOKED like they were supposed to be, but someone should probably check this
+ Don't make commits like this; it's multiple unrelated changes thrown together. I'm still figuring out my way around here
2021-12-01 00:13:15 -06:00
Folkert de Vries
efe07ea4e1
Merge pull request #2090 from rtfeldman/joshuawarner32/fix-remove-spaces-oversights
...
Fix a few places non-0 Located slipped by RemoveSpaces
2021-11-27 16:48:53 +01:00
Joshua Warner
54317f4c0c
Fix a few places non-0 Located slipped by RemoveSpaces
2021-11-27 07:15:05 -08:00
Joshua Warner
16cf95cf6e
Improve formatting of formatter error messages, and also write out the invalidly formatted file separately
2021-11-26 17:18:11 -08:00
Joshua Warner
2547c2ef47
Add comment
2021-11-26 14:03:49 -08:00
Joshua Warner
08c1317cf8
Verify ast matches before/after formatting
2021-11-26 14:00:36 -08:00
Joshua Warner
3f8c6be9e9
Implement 'roc format <dir_or_files>' command
2021-11-22 18:00:25 -08:00