skipTimestamp

Undocumented in source. Be warned that the author may not have intended to support it.
@safe @nogc pure
char
skipTimestamp

Examples

Test skipping over timestamps

import mir.deser.text.tokenizer : tokenizeString;
import mir.deser.text.tokens : IonTokenizerException;

void test(string ts, char result) {
    auto t = tokenizeString(ts);
    assert(t.skipTimestamp() == result);
}

void testFail(string ts) {
    import std.exception : assertThrown;
    auto t = tokenizeString(ts);
    assertThrown!IonTokenizerException(t.skipTimestamp());
}

test("2001T", 0);
test("2001-01T,", ',');
test("2001-01-02}", '}');
test("2001-01-02T ", ' ');
test("2001-01-02T+00:00\t", '\t');
test("2001-01-02T-00:00\n", '\n');
test("2001-01-02T03:04+00:00 ", ' ');
test("2001-01-02T03:04-00:00 ", ' ');
test("2001-01-02T03:04Z ", ' ');
test("2001-01-02T03:04z ", ' ');
test("2001-01-02T03:04:05Z ", ' ');
test("2001-01-02T03:04:05+00:00 ", ' ');
test("2001-01-02T03:04:05.666Z ", ' ');
test("2001-01-02T03:04:05.666666z ", ' ');

testFail(""); 
testFail("2001");
testFail("2001z");
testFail("20011");
testFail("2001-0");
testFail("2001-01");
testFail("2001-01-02Tz");
testFail("2001-01-02T03");
testFail("2001-01-02T03z");
testFail("2001-01-02T03:04x ");
testFail("2001-01-02T03:04:05x ");

Meta