mirror of
https://github.com/neovim/neovim.git
synced 2026-09-05 13:40:57 +00:00
Problem: LPeg is hosted on a single unreliable external hoster, forcing is to mirror it in neovim/deps, which adds maintenance friction. Also, we have already vendored the Lua `re.lua` module. Solution: Vendor all of LPeg v1.1.0; as development is not very active anymore, this should not add much overhead (and allow us to simplify in particular the Zig build scripts). Note: LPeg defines a `luaL_newlib` macro for Lua 5.1, which conflicts with LuaJIT's extension. This requires inlining the macro defined in `lptypes.h` and used in `lptree.c`; see README.md for the patch.
31 lines
736 B
C
31 lines
736 B
C
|
|
#if !defined(lpset_h)
|
|
#define lpset_h
|
|
|
|
#include "lpcset.h"
|
|
#include "lpcode.h"
|
|
#include "lptree.h"
|
|
|
|
|
|
/*
|
|
** Extra information for the result of 'charsettype'. When result is
|
|
** 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 {
|
|
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 charsetinfo *info, int index);
|
|
void tree2cset (TTree *tree, charsetinfo *info);
|
|
|
|
#endif
|