From b2264f139cd7d9f5b4cae0e27316bf0485f2ccef Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 22 Sep 2020 16:52:36 +0300 Subject: [PATCH] chore(classes): Catch and aggressively deprecate old class inheritance --- core/sile.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core/sile.lua b/core/sile.lua index 7f637975a3..62909b3205 100644 --- a/core/sile.lua +++ b/core/sile.lua @@ -57,6 +57,27 @@ SILE.frameParser = require("core/frameparser") SILE.linebreak = require("core/break") require("core/frame") +-- Class system deprecation shims +SILE.baseClass = {} +local _classdeprecation = function () + SU.warn([[ + The inheritance system for SILE classes has been refactored using a + different object model, please update your code as use of the old + model will cause unexpected errors and will eventually be removed. + ]]) + SU.deprecated("SILE.baseclass", "SILE.classes.base", "0.10.10", "0.12.0") +end +setmetatable(SILE.baseClass, { + __index = function(_, key) + _classdeprecation() + return SILE.classes.base[key] + end, + __call = function (_, ...) + _classdeprecation() + return SILE.classes.base(...) + end + }) + SILE.init = function () if not SILE.backend then if pcall(function () require("justenoughharfbuzz") end) then