summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/template.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-11-25 19:17:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-11-25 19:17:55 +0000
commit0e50aa690af6cd9f37fa97b4a521fe523cce3c39 (patch)
treec0ab4edc0dd221dfa3e6fb4eeba049ecc05326fe /libs/web/luasrc/template.lua
parentc647ff9f0e1af211a762dc9a773c1b5c4aacd168 (diff)
libs/web: rewrite template engine, merge lmo library
- template parser: merge lmo library - template parser: rewrite to operate on memory mapped files - template parser: implement proper line number reporting on syntax errors - template parser: process translate tags directly and bypass Lua - template lmo: introduce load_catalog(), change_catalog() and close_catalog() - template lmo: rewrite index processing to operate directly on the memory mapped file - template lmo: implement binary search keys, reducing the lookup complexity to O(log n) - po2lmo: write sorted indixes when generating *.lmo archives - i18n: use the template parser for translations - i18n: stub load(), loadc() and clear() - i18n: map setlanguage() to load_catalog()
Diffstat (limited to 'libs/web/luasrc/template.lua')
-rw-r--r--libs/web/luasrc/template.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index 962c2ea886..72127d1df1 100644
--- a/libs/web/luasrc/template.lua
+++ b/libs/web/luasrc/template.lua
@@ -79,9 +79,8 @@ function Template.__init__(self, name)
-- If we have no valid template throw error, otherwise cache the template
if not self.template then
error("Failed to load template '" .. name .. "'.\n" ..
- "Error while parsing template '" .. sourcefile .. "'.\n" ..
- "A syntax error occured near '" ..
- (err or "(nil)"):gsub("\t", "\\t"):gsub("\n", "\\n") .. "'.")
+ "Error while parsing template '" .. sourcefile .. "':\n" ..
+ (err or "Unknown syntax error"))
else
self.cache[name] = self.template
end