| 243 | | *[gtfs:source_date][gtfs:source_date !~ /^20(1[7-9]|20)-(0[1-9]|1[0-2])-(3[01]|[12][0-9]|0[1-9])$/], |
| 244 | | *[ref:IFOPT ][ref:IFOPT !~ /^(gen:[0-9]{4}|[a-z]{2}:[0-9]{5}):[1-9][0-9]{0,4}(:[0-9]{1,2}(:([A-Z]+[ ]?)?[1-9][0-9]{0,2}[A-Z]?)?)?$/], |
| 245 | | *[gtfs:stop_id][gtfs:stop_id !~ /^(gen:[0-9]{4}|[a-z]{2}:[0-9]{4,5}):[1-9][0-9]{0,4}(:[0-9]{1,2}(:([A-Z]+[ ]?)?[1-9][0-9]{0,2}[A-Z]?)?)?$/] { |
| | 243 | *[gtfs:source_date][gtfs:source_date !~ /^20(1[7-9]|20)-(0[1-9]|1[0-2])-(3[01]|[12][0-9]|0[1-9])$/] { |
| | 256 | } |
| | 257 | /* ref:IFOPT, gtfs:stop_id, gtfs:feed, *:guid, gtfs:source_date */ |
| | 258 | /* FIXME: Get proper syntax as regex displayed. */ |
| | 259 | *[ref:IFOPT ][ref:IFOPT !~ /^(gen:[0-9]{4}|[a-z]{2}:[0-9]{5}):[1-9][0-9]{0,4}(:[0-9]{1,2}(:([A-Z]+[ ]?)?[1-9][0-9]{0,2}[A-Z]?)?)?$/], |
| | 260 | *[gtfs:stop_id][gtfs:stop_id !~ /^(gen:[0-9]{4}|[a-z]{2}:[0-9]{4,5}):[1-9][0-9]{0,4}(:[0-9]{1,2}(:([A-Z]+[ ]?)?[1-9][0-9]{0,2}[A-Z]?)?)?$/] { |
| | 261 | throwError: tr("Value `{0}` for `{1}=*` does not match value syntax.", "{0.value}", "{0.key}"); |
| | 262 | /* throwError: tr("Value `{0}` for `{1}=*` does not match value syntax `{2}`.", "{0.value}", "{0.key}", "{1.value}"); */ |
| | 263 | group: tr("Public Transport GTFS: value syntax"); |
| | 264 | set ErrorSyntaxIFOPT; |
| | 298 | /* short ref:IFOPT */ |
| | 299 | node!.ErrorSyntaxIFOPT[ref:IFOPT !~ /^.+(:.+){4}$/][ref:IFOPT ][public_transport=stop_position], |
| | 300 | node!.ErrorSyntaxIFOPT[gtfs:stop_id !~ /^.+(:.+){4}$/][gtfs:stop_id][public_transport=platform], |
| | 301 | node!.ErrorSyntaxIFOPT[ref:IFOPT !~ /^.+(:.+){4}$/][ref:IFOPT ][public_transport=platform], |
| | 302 | node!.ErrorSyntaxIFOPT[gtfs:stop_id !~ /^.+(:.+){4}$/][gtfs:stop_id][public_transport=platform], |
| | 303 | way!.ErrorSyntaxIFOPT[ref:IFOPT !~ /^.+(:.+){3}$/][ref:IFOPT ][public_transport=platform], |
| | 304 | way!.ErrorSyntaxIFOPT[gtfs:stop_id !~ /^.+(:.+){3}$/][gtfs:stop_id][public_transport=platform], |
| | 305 | relation!.ErrorSyntaxIFOPT[ref:IFOPT !~ /^.+(:.+){3}$/][ref:IFOPT ][public_transport][public_transport =~ /^(platform|stop_area)$/], |
| | 306 | relation!.ErrorSyntaxIFOPT[gtfs:stop_id !~ /^.+(:.+){3}$/][gtfs:stop_id][public_transport][public_transport =~ /^(platform|stop_area)$/] { |
| | 307 | throwWarning: tr("Incomplete `{0}` on `{1}`.", "{2.tag}", "{3.tag}"); |
| | 308 | group: tr("Public Transport GTFS: value syntax"); |
| | 309 | assertMatch: "node public_transport=platform ref:IFOPT=de:09162:1179:31"; |
| | 310 | assertNoMatch: "node public_transport=platform ref:IFOPT=de:09162:1179:53:KIF 1"; |
| | 311 | assertNoMatch: "node public_transport=platform ref:IFOPT=DDDD:09162:1179:3:KIF 1"; |
| | 312 | assertNoMatch: "way public_transport=platform ref:IFOPT=de:09162:1179:21"; |
| | 313 | assertMatch: "relation public_transport=platform ref:IFOPT=de:09162:1179"; |
| | 314 | assertNoMatch: "relation public_transport=platform ref:IFOPT=de:09162:1179:30"; |
| | 315 | assertNoMatch: "relation public_transport=platform ref:IFOPT=de:09162:1179:30:KIF 1"; |
| | 316 | } |