Index: code/trunk/src/tolua/lua/code.lua
===================================================================
--- code/trunk/src/tolua/lua/code.lua	(revision 2087)
+++ code/trunk/src/tolua/lua/code.lua	(revision 2710)
@@ -19,5 +19,5 @@
 --   text = text code
 classCode = {
- text = '',
+    text = '',
 }
 classCode.__index = classCode
@@ -26,46 +26,50 @@
 -- register code
 function classCode:register (pre)
- pre = pre or ''
- -- clean Lua code
- local s = clean(self.text)
- if not s then
-  --print(self.text)
-  error("parser error in embedded code")
- end
+    pre = pre or ''
+    -- clean Lua code
+    local s = clean(self.text)
+    if not s then
+        --print(self.text)
+        error("parser error in embedded code")
+    end
 
- -- get first line
- local _, _, first_line=string.find(self.text, "^([^\n\r]*)")
- if string.find(first_line, "^%s*%-%-") then
-	 if string.find(first_line, "^%-%-##") then
-		first_line = string.gsub(first_line, "^%-%-##", "")
-		if flags['C'] then
-			s = string.gsub(s, "^%-%-##[^\n\r]*\n", "")
-		end
-	 end
- else
- 	first_line = ""
- end
+    -- get first line
+    local _, _, first_line=string.find(self.text, "^([^\n\r]*)")
+    if string.find(first_line, "^%s*%-%-") then
+        if string.find(first_line, "^%-%-##") then
+            first_line = string.gsub(first_line, "^%-%-##", "")
+            if flags['C'] then
+                s = string.gsub(s, "^%-%-##[^\n\r]*\n", "")
+            end
+        end
+    else
+        first_line = ""
+    end
 
- -- convert to C
- output('\n'..pre..'{ /* begin embedded lua code */\n')
- output(pre..' int top = lua_gettop(tolua_S);')
- output(pre..' static unsigned char B[] = {\n   ')
- local t={n=0}
- local b = gsub(s,'(.)',function (c)
-                         local e = ''
-                         t.n=t.n+1 if t.n==15 then t.n=0 e='\n'..pre..'  ' end
-                         return format('%3u,%s',strbyte(c),e)
-                        end
-               )
- output(b..strbyte(" "))
- output('\n'..pre..' };\n')
- if first_line and first_line ~= "" then
- 	output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: '..first_line..'");')
- else
- 	output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code '..code_n..'");')
- end
- output(pre..' lua_settop(tolua_S, top);')
- output(pre..'} /* end of embedded lua code */\n\n')
- code_n = code_n +1
+    -- convert to C
+    output('\n'..pre..'{ /* begin embedded lua code */\n')
+    output(pre..' int top = lua_gettop(tolua_S);')
+    output(pre..' static unsigned char B[] = {\n   ')
+    local t={n=0}
+    local b = gsub(s, '(.)',
+        function (c)
+            local e = ''
+            t.n=t.n+1
+            if t.n==15 then
+             t.n=0 e='\n'..pre..'  '
+            end
+            return format('%3u,%s',strbyte(c),e)
+        end
+    )
+    output(b..strbyte(" "))
+    output('\n'..pre..' };\n')
+    if first_line and first_line ~= "" then
+        output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua embedded: '..first_line..'");')
+    else
+        output(pre..' tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code '..code_n..'");')
+    end
+    output(pre..' lua_settop(tolua_S, top);')
+    output(pre..'} /* end of embedded lua code */\n\n')
+    code_n = code_n +1
 end
 
@@ -73,7 +77,7 @@
 -- Print method
 function classCode:print (ident,close)
- print(ident.."Code{")
- print(ident.." text = [["..self.text.."]],")
- print(ident.."}"..close)
+    print(ident.."Code{")
+    print(ident.." text = [["..self.text.."]],")
+    print(ident.."}"..close)
 end
 
@@ -81,7 +85,7 @@
 -- Internal constructor
 function _Code (t)
- setmetatable(t,classCode)
- append(t)
- return t
+    setmetatable(t,classCode)
+    append(t)
+    return t
 end
 
@@ -89,7 +93,7 @@
 -- Expects a string representing the code text
 function Code (l)
- return _Code {
-  text = l
- }
+    return _Code {
+        text = l
+    }
 end
 
