Mercurial Hosting > luan
diff core/src/luan/modules/Io.luan @ 629:35dde32c02ab 0.15
change String.matches()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 18 Jan 2016 23:07:52 -0700 |
parents | 790d5de23042 |
children | ecd436959855 |
line wrap: on
line diff
--- a/core/src/luan/modules/Io.luan Mon Jan 18 06:42:50 2016 -0700 +++ b/core/src/luan/modules/Io.luan Mon Jan 18 23:07:52 2016 -0700 @@ -92,7 +92,7 @@ for key, value in pairs(obj) do if in_list[key] ~= true then if is_first then is_first = false else %>, <% end - if type(key) == "string" and matches(key,"[a-zA-Z_][a-zA-Z_0-9]*") ~= nil then + if type(key) == "string" and matches(key,"^[a-zA-Z_][a-zA-Z_0-9]*$") ~= nil then %><%=key%><% elseif type(key) == "table" then %>[<<%=key%>>]<%