skipBinary

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

Examples

Test skipping over binary numbers

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

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

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

test("0b0", 0);
test("-0b10 ", ' ');
test("0b010101,", ',');

testFail("0b2");

Meta