More bug fixes

This commit is contained in:
Pieter Vander Vennet 2020-09-09 12:25:56 +02:00
parent 08419f91df
commit 6d2f10e7a3
4 changed files with 4 additions and 5 deletions

View file

@ -14,9 +14,6 @@ function if_then_else_dotted(conditionf, thnf, elsef, arg)
if (condition) then
return applyIfNeeded(thnf, arg)
else
if(elsef == nil) then
return nil
end
return applyIfNeeded(elsef, arg) -- if no third parameter is given, 'els' will be nil
end
end

View file

@ -22,10 +22,10 @@ function parse(string)
end
end
if(string:match("%d*:%d*")) then
if(string:match("%d+:%d+")) then
-- duration in minute
local duration = 0
for part in string:gmatch "%d*" do
for part in string:gmatch "%d+" do
duration = duration * 60 + tonumber(part)
end
return duration

View file

@ -11,3 +11,4 @@ yes,both,15,15,unclassified,,,track,yes,no,,,
yes,both,15,15,service,,,,,,,,
yes,both,15,15,tertiary,,,,,,yes,50,
yes,with,15,15,residential,,,,,,,,roundabout
dismount,both,2.25,2.25,footway,dismount
Can't render this file because it has a wrong number of fields in line 14.

View file

@ -5,3 +5,4 @@ expected,route,duration,interval,_length,comment
null,,,,Ferry is not set
20.442857142857,ferry,00:16,,7155,Waterbus SintAnna-Zwijndrecht - osm.org/way/632117702
9.3326086956522,ferry,00:16,2:00,7155,Non-regular waterbus which goes every two hours. Expected time ppl will wait: 30minutes + 16minutes faring duration = 46minutes for 7km = ~9km/h
24,ferry,0:,0:1,100,
1 expected,route,duration,interval,_length,comment
5 null,,,,Ferry is not set
6 20.442857142857,ferry,00:16,,7155,Waterbus SintAnna-Zwijndrecht - osm.org/way/632117702
7 9.3326086956522,ferry,00:16,2:00,7155,Non-regular waterbus which goes every two hours. Expected time ppl will wait: 30minutes + 16minutes faring duration = 46minutes for 7km = ~9km/h
8 24,ferry,0:,0:1,100,