Uploaded image for project: 'tools.reader'
  1. TRDR-38

Improve error message when trying to compile invalid octal literals

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • 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.

        Attachments

          Activity

            People

            • Assignee:
              desk@danielcompton.net Daniel Compton
              Reporter:
              desk@danielcompton.net Daniel Compton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: