tools.reader

Improve error message when trying to compile invalid octal literals

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

When trying to compile ClojureScript, if an invalid octal literal is present in the source code, e.g. 08 or 09, an exception will be thrown, but the exception does not explain what the issue was, or which line and column the error occurred on:

clojure.lang.ExceptionInfo: failed compiling file:test/myns/myfile.cljs
                    core.clj:4593 clojure.core/ex-info
               compiler.cljc:1343 cljs.compiler$compile_file$fn__3237.invoke
               compiler.cljc:1310 cljs.compiler$compile_file.invoke
   ...
                     Var.java:383 clojure.lang.Var.invoke
                     AFn.java:156 clojure.lang.AFn.applyToHelper
                     Var.java:700 clojure.lang.Var.applyTo
                     main.java:37 clojure.main.main
Caused by: clojure.lang.ExceptionInfo: 
                    core.clj:4593 clojure.core/ex-info
                   reader.clj:907 clojure.tools.reader/read*
                   reader.clj:938 clojure.tools.reader/read
            ...
               compiler.cljc:1172 cljs.compiler$compile_file_STAR_.invoke
               compiler.cljc:1331 cljs.compiler$compile_file$fn__3237.invoke
Caused by: java.lang.NullPointerException:

Also of note, this doesn't fail in the bootstrapped reader, which suggests there may be a bug there.

Activity

Hide
David Nolen added a comment -

This problem appears to originate in tools.reader. If that's the case it should be closed here and opened there. Thanks!

Show
David Nolen added a comment - This problem appears to originate in tools.reader. If that's the case it should be closed here and opened there. Thanks!
Hide
Daniel Compton added a comment -

Fixed in TRDR-36

Show
Daniel Compton added a comment - Fixed in TRDR-36

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: