8 local line_number = 0; |
8 local line_number = 0; |
9 local last_object; |
9 local last_object; |
10 local annotation; |
10 local annotation; |
11 |
11 |
12 local function parse_error(text) |
12 local function parse_error(text) |
13 return nil, text .. " (line " .. line_number .. ")"; |
13 return nil, "ParseError: " .. text .. " (line " .. line_number .. ")"; |
14 end |
14 end |
15 |
15 |
16 for line in data:gmatch("([^\r\n]*)\r?\n") do |
16 for line in data:gmatch("([^\r\n]*)\r?\n") do |
17 line_number = line_number + 1; |
17 line_number = line_number + 1; |
18 if line:sub(1,1) == "[" then |
18 if line:sub(1,1) == "[" then |