[CLJ-849] Add a pseudo-variable containing the current line number Created: 07/Oct/11 Updated: 14/Nov/12 |
|
| Status: | Open |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.3 |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | G. Ralph Kuntz, MD | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Any |
||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
Add a pseudo-variable (similar to *file*), containing the current line number. This should be available during AOT compilation. The name "*line-number*" might be good. It will be useful for diagnostic log messages. Using exception stack traces has poor runtime performance and the line number should be available to the compiler at minimal cost. |
| Comments |
| Comment by Peter Siewert [ 14/Nov/12 3:41 PM ] |
|
Adding initial patch. A symbol's position is now stored in its metadata, just like a seq when it is read with the LispReader. The Compiler.LINE and Compiler.COLUMN values are now updated as each symbol is analyzed. This provides more exact line and column numbers for Compiler errors which will resolve ticket CLJ-420. The Compiler.LINE variable has been interned as clojure.core/line-number Adding extra metadata to symbols resulted in some tests failing due to the extra values. The failing tests have been updated to ignore the new metadata keys. |