aboutsummaryrefslogtreecommitdiff
path: root/lptree.c
diff options
context:
space:
mode:
authorSérgio Queiroz <sqmedeiros@gmail.com>2017-10-04 10:23:06 -0300
committerSérgio Queiroz <sqmedeiros@gmail.com>2017-10-04 10:23:06 -0300
commit54443578aaef5d2198ab772c7f5f53b330f80a7d (patch)
tree4bc60524f6b6027e14e77e761f8e5738e60ae23e /lptree.c
parent02dc7e194e8b26e267221ad10b7655645bd1d467 (diff)
downloadlpeglabel-54443578aaef5d2198ab772c7f5f53b330f80a7d.tar.gz
lpeglabel-54443578aaef5d2198ab772c7f5f53b330f80a7d.tar.bz2
lpeglabel-54443578aaef5d2198ab772c7f5f53b330f80a7d.zip
Returning the error position instead of a suffix of the original string (Issue 18)
Diffstat (limited to 'lptree.c')
-rw-r--r--lptree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lptree.c b/lptree.c
index 19d6b1a..810e267 100644
--- a/lptree.c
+++ b/lptree.c
@@ -1243,7 +1243,7 @@ static int lp_match (lua_State *L) {
1243 if (r == NULL) { /* labeled failure begin */ 1243 if (r == NULL) { /* labeled failure begin */
1244 lua_pushnil(L); 1244 lua_pushnil(L);
1245 lua_pushinteger(L, labelf); 1245 lua_pushinteger(L, labelf);
1246 lua_pushstring(L, sfail); /* Pushing the subject where the failure occurred */ 1246 lua_pushinteger(L, sfail - (s + i) + 1); /* subject position related to the error */
1247 return 3; 1247 return 3;
1248 } /* labeled failure end */ 1248 } /* labeled failure end */
1249 return getcaptures(L, s, r, ptop); 1249 return getcaptures(L, s, r, ptop);