Skip to content

Commit

Permalink
DataHandler: parse out-of-order data properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
torque committed Mar 21, 2016
1 parent 03f684a commit 2b75c88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VersionDetemplater.moon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
versions = {
'src/ConfigHandler': '1.1.4'
'src/DataHandler': '1.0.4'
'src/DataHandler': '1.0.5'
'src/DataWrapper': '1.0.2'
'src/Line': '1.5.2'
'src/LineCollection': '1.1.4'
Expand Down
10 changes: 8 additions & 2 deletions src/DataHandler.moon
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@ class DataHandler
section = 0
for _index, line in ipairs @rawData
unless line\match("^[\t ]+")
if line == "Position" or line == "Scale" or line == "Rotation"
section += 1
if line == "Position"
section = 1
elseif line == "Scale"
section = 2
elseif line == "Rotation"
section = 3
else
section = 0
else
line\gsub "^[\t ]+([%d%.%-]+)[\t ]+([%d%.%-e%+]+)(.*)", ( value1, value2, remainder ) ->
switch section
Expand Down

0 comments on commit 2b75c88

Please sign in to comment.