aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2017-02-27 18:53:07 -0400
committerEduardo Julian2017-02-27 18:53:07 -0400
commite35651387f0c18256ab704af4f62e454d75b5968 (patch)
tree4ff035b999d3f64c9b40efa239272a75b4a70481
parent56f051d1429e4c46f184e3637341ee9c572fe59e (diff)
- Fixed a bug when compiling pattern-matching comparisons for several types.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/compiler/js/lux.clj11
1 files changed, 7 insertions, 4 deletions
diff --git a/luxc/src/lux/compiler/js/lux.clj b/luxc/src/lux/compiler/js/lux.clj
index 4e7ddd8fd..2de9eeec1 100644
--- a/luxc/src/lux/compiler/js/lux.clj
+++ b/luxc/src/lux/compiler/js/lux.clj
@@ -178,19 +178,22 @@
(return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
(&o/$NatPM _value)
- (return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
+ (|do [=value (compile-nat _value)]
+ (return (str "if(" (str "LuxRT.eqI64(" cursor-peek "," _value ")") ") { " pm-fail " }")))
(&o/$IntPM _value)
- (return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
+ (|do [=value (compile-int _value)]
+ (return (str "if(" (str "LuxRT.eqI64(" cursor-peek "," _value ")") ") { " pm-fail " }")))
(&o/$DegPM _value)
- (return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
+ (|do [=value (compile-deg _value)]
+ (return (str "if(" (str "LuxRT.eqI64(" cursor-peek "," _value ")") ") { " pm-fail " }")))
(&o/$RealPM _value)
(return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
(&o/$CharPM _value)
- (return (str "if(" cursor-peek " !== " (pr-str (str _value)) ") { " pm-fail " }"))
+ (return (str "if(" (str "(" cursor-peek ").C") " !== " (pr-str (str _value)) ") { " pm-fail " }"))
(&o/$TextPM _value)
(return (str "if(" cursor-peek " !== " (pr-str _value) ") { " pm-fail " }"))