aboutsummaryrefslogtreecommitdiff
path: root/lptree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lptree.c')
-rw-r--r--lptree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lptree.c b/lptree.c
index f290d63..548128d 100644
--- a/lptree.c
+++ b/lptree.c
@@ -706,8 +706,8 @@ static int lp_throw (lua_State *L) {
706 Labelset ls = 0; 706 Labelset ls = 0;
707 int i; 707 int i;
708 for (i = 1; i <= n; i++) { 708 for (i = 1; i <= n; i++) {
709 int d = (int)luaL_checkinteger(L, i); 709 long long int d = (long long int)luaL_checkinteger(L, i);
710 luaL_argcheck(L, d >= 0 && d < (int)MAXLABELS, i, "invalid label index"); 710 luaL_argcheck(L, d >= 0 && d < (long long int)MAXLABELS, i, "invalid label index");
711 setlabel(ls, d); 711 setlabel(ls, d);
712 } 712 }
713 newlabelleaf(L, ls); 713 newlabelleaf(L, ls);
@@ -723,8 +723,8 @@ static int lp_labchoice (lua_State *L) {
723 int i; 723 int i;
724 Labelset ls = 0; 724 Labelset ls = 0;
725 for (i = 3; i <= n; i++) { 725 for (i = 3; i <= n; i++) {
726 int d = (int)luaL_checkinteger(L, i); 726 long long int d = (long long int)luaL_checkinteger(L, i);
727 luaL_argcheck(L, d >= 0 && d < (int)MAXLABELS, i, "invalid label index"); 727 luaL_argcheck(L, d >= 0 && d < (long long int)MAXLABELS, i, "invalid label index");
728 setlabel(ls, d); 728 setlabel(ls, d);
729 } 729 }
730 tree = newroot2sib(L, TLabChoice); 730 tree = newroot2sib(L, TLabChoice);
@@ -1205,11 +1205,11 @@ static int lp_match (lua_State *L) {
1205 r = match(L, s, s + i, s + l, code, capture, ptop, &labelf, &sfail); /* labeled failure */ 1205 r = match(L, s, s + i, s + l, code, capture, ptop, &labelf, &sfail); /* labeled failure */
1206 /*printf("sfail = %s\n", sfail);*/ 1206 /*printf("sfail = %s\n", sfail);*/
1207 if (r == NULL) { /* labeled failure begin */ 1207 if (r == NULL) { /* labeled failure begin */
1208 int j = 0; 1208 long long int j = 0;
1209 int n = 1; 1209 int n = 1;
1210 lua_pushnil(L); 1210 lua_pushnil(L);
1211 while (j < (int) MAXLABELS) { 1211 while (j < (long long int) MAXLABELS) {
1212 if (labelf & (1 << j)) { 1212 if (labelf & (1ULL << j)) {
1213 lua_pushinteger(L, j); 1213 lua_pushinteger(L, j);
1214 n++; 1214 n++;
1215 break; /* Changing the semantics: only one label */ 1215 break; /* Changing the semantics: only one label */