Completed
Details
Details
Assignee
Unassigned
UnassignedReporter
Alex Miller
Alex MillerLabels
Approval
Ok
Patch
Code and Test
Priority

Affects versions
Fix versions
Created October 31, 2018 at 5:16 PM
Updated November 6, 2018 at 12:33 PM
Resolved November 6, 2018 at 12:33 PM
Problems to address:
Refine error phases to separate "syntax checking" from the phase itself (in compile and macroexpand)
Use phase names that better reflect the actual location of the error (ie :read-source rather than :read)
Break ex-str into two parts: ex-triage (semantic analysis of Throwable data) and ex-str (string-making) to increase options for reuse by other tools
For execution errors, report the line in the stack reflecting the user operation (outside core), rather than in the guts of core (RT.java, etc)
Accept meta on repl forms (:clojure.core/eval-file or :line) and use that as if it was the source file/line.
Patch: clj-2420-5.patch
Screened: clj-2420-5.patch
Changes:
Compiler.java
CompilerException - adjust phase names
remove private isMacroSyntaxCheck() - now covered at point of capture
set correct compiler exception phase. currently we bucket all compile errors into :compile-syntax-check. later, we can refine compiler errors and separate some into :compilation. Right now, there is no consistent use of exceptions or way to do this. The code is all ready to work when those change are made.
modify eval() to look for and bind file and source-path based on meta :clojure.core/eval-file
main.clj
removed some commented out dead code
added predicate to determine whether stack frame class is a core class
added renumbering-read to allow a re-read with line number set from first read
removed init-cause (no longer needed)
added ex-triage, which takes Throwable->map data and emits an error analysis
made ex-str (new in 1.10) take ex-triage data as input and produce a string
repl-caught - now uses Throwable->map, ex-triage
repl - uses new phase name, removes file setting (moved to Compiler.eval())
repl.clj - updated phases to report special message for pst
Also see attached error-results.txt file showing output of a set of examples in each phase. Additional manual tests were run against errors reporting from within files, rather than at repl.