Commit Graph

16972 Commits

Author SHA1 Message Date
Mitchell Rosen
2942ed62fe fix handling of namespace blocks in term parser 2024-08-27 15:09:18 -04:00
Mitchell Rosen
0bed3fcc7f delete commented-out code 2024-08-26 13:54:10 -04:00
Mitchell Rosen
7d7df0e90c ⅄ term-name-resolution-change → type-name-resolution-change 2024-08-26 13:52:41 -04:00
Mitchell Rosen
989265816e ⅄ trunk → term-name-resolution-change 2024-08-26 13:50:39 -04:00
Mitchell Rosen
a0662ff81b ⅄ trunk → type-name-resolution-change 2024-08-26 13:50:25 -04:00
Mitchell Rosen
38c148272f fix missing record field 2024-08-26 13:49:43 -04:00
Mitchell Rosen
af8315e789 restore better error messages from type checker, not parser, on term out-of-scope 2024-08-26 13:45:46 -04:00
Arya Irani
6299fc3eb4
Merge pull request #5299 from unisonweb/cp/kill-config
Kill Configurator
2024-08-26 13:44:37 -04:00
Mitchell Rosen
bbb04d9da2 get the transcripts passing (but a couple are still broken) 2024-08-26 13:37:19 -04:00
Chris Penner
2e71dff47d Kill Configurator and Unison Config 2024-08-25 15:21:27 -07:00
Rúnar
e9ca76f651
Merge pull request #5273 from unisonweb/precedence
Add infix operator precedence rules
2024-08-23 21:21:13 -04:00
Rúnar
8a70414fdf More parens around do blocks 2024-08-23 19:17:24 -04:00
Rúnar
eefacbf48b Remove comments 2024-08-23 15:51:26 -04:00
Mitchell Rosen
7cb62a2856 delete now-unused UnknownAbilityConstructor/UnknownDataConstructor errors 2024-08-23 12:20:25 -04:00
Mitchell Rosen
82d012fdb1 emit a proper resolution result for constructors 2024-08-23 12:08:22 -04:00
Paul Chiusano
a1e188b061
Merge pull request #5291 from sellout/fix-dev-ui-install
Fix dev-ui-install.sh
2024-08-23 08:48:46 -05:00
Paul Chiusano
120765330b
Merge pull request #5297 from sellout/impossible-in-lexer
Turn a possible “impossible” into a parse failure
2024-08-23 08:47:22 -05:00
Paul Chiusano
7178ec2266
Merge pull request #5298 from sellout/empty-match
Support pattern matching on empty types
2024-08-23 08:46:46 -05:00
Greg Pfeil
1132a6b4bd
Support pattern matching on empty types
Previously, `match` and `cases` expressions needed to have at least one
pattern to match on. This allows them to work with zero patterns, which
is useful for matching on empty types.

Since `EmptyMatch` is no longer a failure case, errors that previously
said “I expected some patterns after a match / with or cases but I
didn't find any,” now say “Pattern match doesn't cover all possible
cases”.

Fixes #4731.
2024-08-22 23:30:02 -06:00
Greg Pfeil
a1ba98e38a
Add a transcript to test empty match
It currently fails.
2024-08-22 23:24:50 -06:00
Greg Pfeil
a025454783
Turn a possible “impossible” into a parse failure
From #5179, there’s a case where we hit an `error "impossible"`, which
doesn’t provide much context. This turns it into a parse failure, so we
have #thte state of the lexer when this happens again. It also adds a
comment that describes when this “impossible” case gets hit.
2024-08-22 15:30:56 -06:00
Mitchell Rosen
f03f784ed8 show type suggestions for holes again 2024-08-22 13:40:53 -04:00
Mitchell Rosen
677e989730 ⅄ trunk → term-name-resolution-change 2024-08-22 13:24:07 -04:00
Mitchell Rosen
f9113108c8 get ambiguous term error message properly suffixifying names 2024-08-22 13:12:42 -04:00
Mitchell Rosen
4c6139ae7d term name resolution tweak: don't prefer names from the file over names from the namespace 2024-08-21 15:01:51 -04:00
mergify[bot]
b868fecad9
Merge pull request #5288 from puffnfresh/bug/windows-ui
Fix UI on Windows
2024-08-21 16:21:40 +00:00
Rúnar
c8414eb9ce Simpler infix printer 2024-08-21 00:39:07 -04:00
Brian McKenna
a7a80c90e7 Add puffnfresh to contributors 2024-08-21 00:47:52 +00:00
Rúnar
da75484dd2 Merge branch 'trunk' of https://github.com/unisonweb/unison into precedence 2024-08-20 14:44:53 -04:00
Rúnar
4c166f05d3 Add exponentiation operators 2024-08-20 13:58:50 -04:00
Greg Pfeil
b1a4d73ece
Fix dev-ui-install.sh
I ran into this when i tried running it in a non-POSIX shell. Nothing
happened. Bash, when asked to run a script without a shebang will
interpret it itself, while other shells behave differently (and I think
this even depends on the OS – BSD (like macOS) & Linux handle `execvp`
differently).

This adds a shebang and some “strict” settings.
2024-08-20 11:56:20 -06:00
Rúnar
3e40cb174f Add roundtrip tests 2024-08-20 08:47:17 -04:00
Rúnar
b64ac8be62 Get rid of commented-out code 2024-08-20 08:34:42 -04:00
Rúnar
f48880ff42 More parens for do blocks 2024-08-20 08:29:53 -04:00
Brian McKenna
d242ae9353 Fix UI on Windows
The quotes seem to be preventing the UI from loading on my system
and quotes are not needed in this situation in Batch.
2024-08-20 11:20:06 +00:00
Mitchell Rosen
035fe0a585 ⅄ trunk → type-name-resolution-change 2024-08-19 16:08:21 -04:00
Arya Irani
e388786b48
Merge pull request #5282 from sellout/fix-blank-identifiers
Change handling of “blank” identifiers
2024-08-18 17:06:22 -04:00
Arya Irani
1c5a4e6c67
Merge pull request #5285 from unisonweb/24-08-15-namespace-directive
feat: namespace directive
2024-08-18 12:30:15 -04:00
Rúnar
3e896408e9 transcripts 2024-08-17 22:03:57 -04:00
Rúnar
29981373ee Transcripts 2024-08-17 22:02:41 -04:00
Rúnar
1470085d3f Get rid of confusing precedence levels 2024-08-16 23:44:19 -04:00
Mitchell Rosen
df2c76aa42 rerun generic-parse-errors transcript 2024-08-16 15:25:59 -04:00
Mitchell Rosen
2f82c7eb85 fix file ordering 2024-08-16 15:19:36 -04:00
Mitchell Rosen
699a16acdd move a binding 2024-08-16 15:07:32 -04:00
Mitchell Rosen
7b3b65f55e implement namespace directive 2024-08-16 15:06:34 -04:00
Rúnar
d43288a1e2 Adapt old infix printer to new rules 2024-08-16 13:10:45 -04:00
Greg Pfeil
eff07ae662
Improve the Show (BlockTree a) instance
This makes it much easier to read the output when debugging the lexer.
And it should be `Read`-compatible..

There’s still room for improvement, though:
```haskell
Block (Open "scratch.u")
  [
    [
      Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "dontMap"} :| [])))),
      Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "f"} :| [])))),
      Block (Open "=")
        [
          [
            Block (Open "cases")
              [
                [
                  Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "None"} :| [])))),
                  Block (Open "->")
                    [
                      [
                        Leaf (Reserved "false"),
                      ],
                    ]
                    (Just Close),
                  Leaf (Semi True),
                ],
                [
                  Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "Some"} :| [])))),
                  Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "_unused"} :| [])))),
                  Block (Open "->")
                    [
                      [
                        Leaf (WordyId (NameOnly (Name Relative (NameSegment {toUnescapedText = "f"} :| [])))),
                        Leaf (Numeric "2"),
                      ],
                    ]
                    (Just Close),
                ],
              ]
              (Just Close),
          ],
        ]
        (Just Close),
    ],
  ]
  (Just Close)
```
2024-08-16 08:27:36 -06:00
Greg Pfeil
ebda5ae6e3
Change handling of “blank” identifiers
Previously, they were tokenized separately from other identifiers, but
then most handling checked both tokens anyway. This now always parses
“blanks” as normal identifiers and checks their blankness at the few
places we care about it.

There were two places that treated `Blank` differently than `WordyId`,
and those are preserved. There were also two places where `Blank ""`
(`_`) was treated differently than `Blank n` (`_withSomeSuffix`), and
those have been eliminated.

Fixes #2822.
2024-08-16 08:27:36 -06:00
Greg Pfeil
50429143d1
Add a failing transcript for #2822 2024-08-15 18:48:23 -06:00
Rúnar
725ee3b6d5 Modify infix printer 2024-08-15 14:59:44 -04:00