From 012cf9c86cf91cb8354e229bde335592d41b84b2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 27 Apr 2023 10:32:39 -0300 Subject: Compact charsets used in trees, too. --- lpcset.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lpcset.h') diff --git a/lpcset.h b/lpcset.h index e5152c4..b69fef9 100644 --- a/lpcset.h +++ b/lpcset.h @@ -4,22 +4,27 @@ #include "lpcset.h" #include "lpcode.h" +#include "lptree.h" /* ** Extra information for the result of 'charsettype'. When result is -** IChar, 'aux1' is the character. When result is ISet, 'aux1' is the -** offset (in bytes), 'size' is the size (in bytes), and -** 'delt' is the default value for bytes outside the set. +** IChar, 'offset' is the character. When result is ISet, 'cs' is the +** supporting bit array (with offset included), 'offset' is the offset +** (in bytes), 'size' is the size (in bytes), and 'delt' is the default +** value for bytes outside the set. */ typedef struct { - int aux1; + const byte *cs; + int offset; int size; int deflt; } charsetinfo; +int tocharset (TTree *tree, Charset *cs); Opcode charsettype (const byte *cs, charsetinfo *info); -byte getbytefromcharset (const byte *cs, const charsetinfo *info, int index); +byte getbytefromcharset (const charsetinfo *info, int index); +void tree2cset (TTree *tree, charsetinfo *info); #endif -- cgit v1.2.3-55-g6feb