From 1feb9a64b89b130b452b56ab430c100acd0645c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=96=9F=20=E2=96=96=E2=96=9F=20=E2=96=96?= Date: Tue, 24 Feb 2015 14:35:47 +0100 Subject: [PATCH 1/2] added support for luajit --- repl/plugins/pretty_print.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/repl/plugins/pretty_print.lua b/repl/plugins/pretty_print.lua index b7fade8..6de449f 100644 --- a/repl/plugins/pretty_print.lua +++ b/repl/plugins/pretty_print.lua @@ -99,10 +99,11 @@ local type_order = { number = 0, string = 1, userdata = 2, - table = 3, - thread = 4, - boolean = 5, - ['function'] = 6, + cdata = 3, + table = 4, + thread = 5, + boolean = 6, + ['function'] = 7, } local function cross_type_order(a, b) From e226984d9e17adf221bf1e3db96622a1e5a8f4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=96=9F=20=E2=96=96=E2=96=9F=20=E2=96=96?= Date: Tue, 24 Feb 2015 14:36:31 +0100 Subject: [PATCH 2/2] luajit is much more restrictive when it comes to type comparison --- repl/plugins/pretty_print.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repl/plugins/pretty_print.lua b/repl/plugins/pretty_print.lua index 6de449f..867377b 100644 --- a/repl/plugins/pretty_print.lua +++ b/repl/plugins/pretty_print.lua @@ -111,7 +111,7 @@ local function cross_type_order(a, b) local pos_b = type_order[ type(b) ] if pos_a == pos_b then - return a < b + return tostring(a) < tostring(b) else return pos_a < pos_b end