Super work on this parser -- it's extremely handy!
I'm getting a syntax error when passing certain valid dates that meet edtf standards and was wondering if this was expected behavior (and if you have a suggested way for me to handle this while still catching "real"/un-parseable errors).
For instance:
If a user inputs "1892", edtfy returns the string with no error (=great!).
If a user inputs "around 1892", edtfy returns 1892~ (=awesome!).
If a user inputs "1892~", edtfy throws:
peg$SyntaxError {message: "Expected " ", " / ", " A ", " B2 ", " C", " O ", "…", "u", "x", [0-9]
or end of input but "~" found.", expected: Array[13], found: "~",
location: Object, name: "SyntaxError"}
which I didn't expect (I was expecting it to just pass the string back to me).
Similarly, if a user inputs "open", it throws a similar peg error:
peg$SyntaxError {message: "Expected " ", " / ", " A ", " B2 ", " O ", "*", "-…, [0-9], [ivxlcdm]
or end of input but "O" found.", expected: Array[22], found: "O",
location: Object, name: "SyntaxError"}
I checked with "1892?" and edtfy passes the string back to me, which was what I was expecting with "1892~".
Am I missing something? Thanks!