-
Notifications
You must be signed in to change notification settings - Fork 372
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
The lexer needs to be more informative #657
Comments
I've since managed to reproduce this in another condition: (defn [foo] (+1 foo))
" That's right, a "lost" quote near EOF will completely screw up the lexer. Fiddling with LexException a bit and removing the guard for positive line numbers, I got this:
So it is possible to provide a little more info (and at least point to the offending character). I'm at a loss as to why the line and column are set to negative values here, but I haven't looked at the tokenizer properly yet -- it seems to be a bug in |
This needs to be fixed as it is still an issue. I did some manual "binary search" by deleting chunks of code in a source file until finding the issue, but that is not always viable either. How about at least outputting the file, row and column of the previous token!? |
This commit refactors the exception/error classes and their handling, keeps Hy source string and their originating file (if any) information closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook`. It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file (if any) information closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling, keeps Hy source strings and their originating file information (if any) closer to the origin of an exception (so that calling code isn't responsible for annotating exceptions), and provides minimally intrusive traceback print-out filtering via a context manager that temporarily alters `sys.excepthook` (enabled by default for the Hy interpreter). It also provides an environment variable, `HY_COLORED_ERRORS`, and package variable, `hy.errors.__colored_errors`, that enables/disables manual error coloring. Closes hylang#657, closes hylang#1510, closes hylang#1429.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
This commit refactors the exception/error classes and their handling. It also retains Hy source strings and their originating file information, when available, all throughout the core parser and compiler functions. As well, with these changes, calling code is no longer responsible for providing source and file details to exceptions, Closes hylang#657.
I've just spent a long while trying to debug the following situation:
a.hy
had a single-quoted string (yeah, I know...)b.hy
importeda
When trying to run
b.hy
, I got:...without a single clue as to the file or line the error was actually in. So a little more information might save a lot of time...
The text was updated successfully, but these errors were encountered: