Fixed a variable redeclaration
[prosody.git] / tools / erlparse.lua
index c4372243273838cc0743a1ffa51fee8b405391fa..af1628e57e3487f6f4bbfb9da64df30d1bdbe30a 100644 (file)
@@ -1,3 +1,23 @@
+-- Prosody IM v0.1
+-- Copyright (C) 2008 Matthew Wild
+-- Copyright (C) 2008 Waqas Hussain
+-- 
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+-- 
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+-- 
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+--
+
+
 \r
 local file = nil;\r
 local last = nil;\r
@@ -52,7 +72,7 @@ local function readSpecialString()
        read("<"); read("<"); -- read <<\r
        local str = "";\r
        if peek() == "\"" then\r
-               local str = readString();\r
+               str = readString();\r
        elseif peek() ~= ">" then\r
                error();\r
        end\r
@@ -98,7 +118,7 @@ readItem = function()
                return readString();\r
        elseif ch == "<" then\r
                return readSpecialString();\r
-       elseif isSpace(ch) or ch == "," then\r
+       elseif isSpace(ch) or ch == "," or ch == "|" then\r
                read();\r
                return readItem();\r
        else\r