New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spell-check unbound identifiers #4438
Comments
Comment author: @xavierleroy It's a cool hack, but I'm not sure this has its place in a compiler -- looks more like a job for a programming environment. I'll leave this as a feature wish. |
Comment author: thelema I got the idea from a compiler I regard as having the best error messages: GNAT. This feature has saved me plenty of work tracking down correct spellings. I admit that it could also be implemented in an IDE, but it'd become much more hackish there, with having to keep track of scope and namespaces, unless the compiler were (too) strongly integrated into the IDE (like Eclipse). |
Comment author: thelema Additional patch piece that fixes an uncaught exception in the toplevel when dealing with values in modules. diff --git a/toplevel/genprintval.ml b/toplevel/genprintval.ml
|
Comment author: @gasche I independently proposed the exact same feature, with a rather similar implementation (but using a generic edit distance test with a cutoff of 3 instead of a specialized implementation), in #5768. I suppose people where more ready to the idea at this later time, so the feature got more support and was eventually integrated. |
Original bug ID: 4438
Reporter: thelema
Status: closed (set by @gasche on 2013-07-28T19:27:51Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Monitored by: mehdi @ygrek ertai @yakobowski
Bug description
I have modified my copy of ocaml to report more information on failure to locate an identifier. It searches through the tree of currently bound identifiers for identifiers that could have been intended (looking for a single insertion, deletion, transposition or error). The first one of these is printed out as part of the error message, as follows:
File "coml.ml", line 468, characters 19-23:
Unbound value acts, possible misspelling of act
Additional information
Patch applies to 3.10.0 source tree.
File attachments
The text was updated successfully, but these errors were encountered: