diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-21 15:29:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-21 15:29:53 -0300 |
commit | 9f7183c280f310c0d0b49b7b9c3b8eac297fafa7 (patch) | |
tree | 503392ee1a94f6446151a0b90babe8235efdb573 /lpvm.c | |
parent | 7b42a7b13f9c6655dfa7c5951de46dcf0642b0a6 (diff) | |
download | lpeg-9f7183c280f310c0d0b49b7b9c3b8eac297fafa7.tar.gz lpeg-9f7183c280f310c0d0b49b7b9c3b8eac297fafa7.tar.bz2 lpeg-9f7183c280f310c0d0b49b7b9c3b8eac297fafa7.zip |
Field Instruction.key put inside a union
So that we can get its space for other uses, if needed.
Diffstat (limited to 'lpvm.c')
-rw-r--r-- | lpvm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #define getoffset(p) (((p) + 1)->offset) | 21 | #define getoffset(p) (((p) + 1)->offset) |
22 | 22 | ||
23 | static const Instruction giveup = {{IGiveup, 0, 0}}; | 23 | static const Instruction giveup = {{IGiveup, 0, {0}}}; |
24 | 24 | ||
25 | 25 | ||
26 | /* | 26 | /* |
@@ -249,12 +249,12 @@ const char *match (lua_State *L, const char *o, const char *s, const char *e, | |||
249 | continue; | 249 | continue; |
250 | } | 250 | } |
251 | case IChar: { | 251 | case IChar: { |
252 | if ((byte)*s == p->i.aux && s < e) { p++; s++; } | 252 | if ((byte)*s == p->i.aux1 && s < e) { p++; s++; } |
253 | else goto fail; | 253 | else goto fail; |
254 | continue; | 254 | continue; |
255 | } | 255 | } |
256 | case ITestChar: { | 256 | case ITestChar: { |
257 | if ((byte)*s == p->i.aux && s < e) p += 2; | 257 | if ((byte)*s == p->i.aux1 && s < e) p += 2; |
258 | else p += getoffset(p); | 258 | else p += getoffset(p); |
259 | continue; | 259 | continue; |
260 | } | 260 | } |
@@ -273,7 +273,7 @@ const char *match (lua_State *L, const char *o, const char *s, const char *e, | |||
273 | continue; | 273 | continue; |
274 | } | 274 | } |
275 | case IBehind: { | 275 | case IBehind: { |
276 | int n = p->i.aux; | 276 | int n = p->i.aux1; |
277 | if (n > s - o) goto fail; | 277 | if (n > s - o) goto fail; |
278 | s -= n; p++; | 278 | s -= n; p++; |
279 | continue; | 279 | continue; |
@@ -404,7 +404,7 @@ const char *match (lua_State *L, const char *o, const char *s, const char *e, | |||
404 | capture[captop].s = s - getoff(p); | 404 | capture[captop].s = s - getoff(p); |
405 | /* goto pushcapture; */ | 405 | /* goto pushcapture; */ |
406 | pushcapture: { | 406 | pushcapture: { |
407 | capture[captop].idx = p->i.key; | 407 | capture[captop].idx = p->i.aux2.key; |
408 | capture[captop].kind = getkind(p); | 408 | capture[captop].kind = getkind(p); |
409 | captop++; | 409 | captop++; |
410 | capture = growcap(L, capture, &capsize, captop, 0, ptop); | 410 | capture = growcap(L, capture, &capsize, captop, 0, ptop); |