diff options
author | Eduardo Julian | 2016-12-18 23:48:52 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-12-18 23:48:52 -0400 |
commit | e32a74c4c7a4e9b6b61b20f3ac62149eb649bdd5 (patch) | |
tree | 0891edfe451c1165d2707665734e90ab576f62cf /luxc/src | |
parent | 0df1d8855ab54abea8c729a3575b30c8499cc7e0 (diff) |
- Better error messages when analysing classes, interfaces and anonymous classes.
Diffstat (limited to 'luxc/src')
-rw-r--r-- | luxc/src/lux/analyser/host.clj | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/luxc/src/lux/analyser/host.clj b/luxc/src/lux/analyser/host.clj index 6dd7f3da8..977a7b1fe 100644 --- a/luxc/src/lux/analyser/host.clj +++ b/luxc/src/lux/analyser/host.clj @@ -1314,19 +1314,22 @@ ;; else (->> (&/fail-with-loc (str "[Analyser Error] Unknown host procedure: " [category proc])) (if-let [[_ _def-code] (re-find #"^interface:(.*)$" proc)] - (&reader/with-source "interface" _def-code - (|do [[=gclass-decl =supers =anns =methods] &&a-parser/parse-interface-def] - (analyse-jvm-interface analyse compile-interface =gclass-decl =supers =anns =methods)))) + (|do [[_module _line _column] &/cursor] + (&reader/with-source (str "interface@" "(" _module "," _line "," _column ")") _def-code + (|do [[=gclass-decl =supers =anns =methods] &&a-parser/parse-interface-def] + (analyse-jvm-interface analyse compile-interface =gclass-decl =supers =anns =methods))))) (if-let [[_ _def-code] (re-find #"^class:(.*)$" proc)] - (&reader/with-source "class" _def-code - (|do [[=gclass-decl =super-class =interfaces =inheritance-modifier =anns =fields =methods] &&a-parser/parse-class-def] - (analyse-jvm-class analyse compile-class =gclass-decl =super-class =interfaces =inheritance-modifier =anns =fields =methods)))) + (|do [[_module _line _column] &/cursor] + (&reader/with-source (str "class@" "(" _module "," _line "," _column ")") _def-code + (|do [[=gclass-decl =super-class =interfaces =inheritance-modifier =anns =fields =methods] &&a-parser/parse-class-def] + (analyse-jvm-class analyse compile-class =gclass-decl =super-class =interfaces =inheritance-modifier =anns =fields =methods))))) (if-let [[_ _def-code] (re-find #"^anon-class:(.*)$" proc)] - (&reader/with-source "anon-class" _def-code - (|do [[=super-class =interfaces =ctor-args =methods] &&a-parser/parse-anon-class-def] - (analyse-jvm-anon-class analyse compile-class exo-type =super-class =interfaces =ctor-args =methods)))) + (|do [[_module _line _column] &/cursor] + (&reader/with-source (str "anon-class@" "(" _module "," _line "," _column ")") _def-code + (|do [[=super-class =interfaces =ctor-args =methods] &&a-parser/parse-anon-class-def] + (analyse-jvm-anon-class analyse compile-class exo-type =super-class =interfaces =ctor-args =methods))))) (if-let [[_ _class] (re-find #"^instanceof:([^:]+)$" proc)] (analyse-jvm-instanceof analyse exo-type _class ?values)) |