aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
authorEduardo Julian2016-12-18 23:48:52 -0400
committerEduardo Julian2016-12-18 23:48:52 -0400
commite32a74c4c7a4e9b6b61b20f3ac62149eb649bdd5 (patch)
tree0891edfe451c1165d2707665734e90ab576f62cf /luxc/src
parent0df1d8855ab54abea8c729a3575b30c8499cc7e0 (diff)
- Better error messages when analysing classes, interfaces and anonymous classes.
Diffstat (limited to 'luxc/src')
-rw-r--r--luxc/src/lux/analyser/host.clj21
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))