diff options
author | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-10-04 10:23:06 -0300 |
---|---|---|
committer | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-10-04 10:23:06 -0300 |
commit | 54443578aaef5d2198ab772c7f5f53b330f80a7d (patch) | |
tree | 4bc60524f6b6027e14e77e761f8e5738e60ae23e /lptree.c | |
parent | 02dc7e194e8b26e267221ad10b7655645bd1d467 (diff) | |
download | lpeglabel-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |