Open zslayton opened 3 years ago
The ion-java
tests do treat $ion_MAJOR_MINOR
as an IVM. See: https://github.com/amzn/ion-java/blob/0eb62ba92633f03e9f3175bb77f1b3214fcc1cdd/src/com/amazon/ion/impl/IonReaderTextUserX.java#L59
Agreed. It's also referenced (but not defined! 😬) in the ANTLR grammar.
I think the spec should say it. As a developer, I want to be able to implement Ion by looking at the spec. I don't want to have to take a survey of the spec, ion-tests
, and popular implementations to figure out what the Right Thing To Do :tm:
is.
The Ion spec's Symbols section description says:
There is no broader discussion of Ion Version Marker syntax; in particular, no syntax is reserved for future Ion Version Markers. Readers might reasonably assume that IVMs always follow the format
$ion_MAJOR_MINOR
, but this is not actually provided for by the spec. The System symbols section of the spec says:suggesting that the intent was to formalize
$ion_MAJOR_MINOR
. However, without an explicit requirement in the spec, it is unclear whether an Ion 1.0 text reader that encountered$ion_2_0
in a stream should treat it as:$ion_*
prefixWe should clarify the spec and add a test enforcing the expected behavior.