-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest alternate variable names based on edit distance (#378)
Closes #180. For both type variables and term variables, when an unbound variable is encountered we now suggest any in-scope variables or constants which are an edit distance of 1 away (i.e. one transposition, insertion, deletion, or replacement).
- Loading branch information
Showing
9 changed files
with
97 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
Error: encountered undefined name REPL.even. Maybe you haven't defined it yet? | ||
Error: there is nothing named fo. | ||
Perhaps you meant 'foo'? | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound.html | ||
Error: there is nothing named ofo. | ||
Perhaps you meant 'foo'? | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound.html | ||
Error: there is nothing named for. | ||
Perhaps you meant 'foo' or 'or'? | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound.html | ||
Error: there is nothing named oof. | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound.html | ||
Error: there is nothing named Foo. | ||
Perhaps you meant 'foo'? | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
even : Z -> Bool | ||
even(2) | ||
foo : N | ||
foo = 3 | ||
fo + 1 | ||
ofo + 1 | ||
for + 1 | ||
oof + 1 | ||
Foo + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Loading unboundtyvar.disco... | ||
While checking unboundtyvar.Ty: | ||
Error: Unknown type variable 'b'. | ||
Perhaps you meant 'a'? | ||
https://disco-lang.readthedocs.io/en/latest/reference/unbound-tyvar.html |