BUG/MINOR: lua: Map.end are not reliable because "end" is a reserved keyword
This patch change the names prefixing it by a "_". So "end" becomes "_end".
The backward compatibility with names without the prefix "_" is assured.
In other way, another the keyword "end" can be used like this: Map['end'].
Thanks Robin H. Johnson for the bug repport
This should be backported in version 1.6 and 1.7
diff --git a/src/hlua.c b/src/hlua.c
index bfb9c94..41f1805 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -7258,6 +7258,10 @@
/* register pattern types. */
for (i=0; i<PAT_MATCH_NUM; i++)
hlua_class_const_int(gL.T, pat_match_names[i], i);
+ for (i=0; i<PAT_MATCH_NUM; i++) {
+ snprintf(trash.str, trash.size, "_%s", pat_match_names[i]);
+ hlua_class_const_int(gL.T, trash.str, i);
+ }
/* register constructor. */
hlua_class_function(gL.T, "new", hlua_map_new);