Skip to content

Fix the hacky solution for adjusting FlexSym system SIDs #946

Description

@popematt

A hacky solution was introduced in #944. It works for now, but it will break if the Ion 1.1 system symbol table gets significantly larger.

// FIXME: This is a hack that works as long as our system symbol table doesn't grow to
// more than ~95 symbols. We need this hack because when we have to read the FixedInt,
// we don't know whether it's a tagless FlexSym or a Regular value.
// Possible solutions include:
// * changing the spec so that FlexSym System SIDs line up with the regular System SIDs
// * Introducing a dummy IonTypeID that indicates that we need to add the bias
// * Update IonCursorBinary.slowSkipFlexSym_1_1() to put the id into valueMarker.endIndex,
// though that seems to have its own problems.
if (id >= FLEX_SYM_SYSTEM_SYMBOL_OFFSET) {
id = id - FLEX_SYM_SYSTEM_SYMBOL_OFFSET;
}

Part of the fix may involve solving this problem:

// FIXME: See if we can set the SID in the endIndex here without causing the slow reader to get confused
// about where the end of the value is for tagless symbols.
// I.e. use setSystemSymbolMarker(markerToSet, (byte)(specialByte - FLEX_SYM_SYSTEM_SYMBOL_OFFSET));
markerToSet.typeId = SYSTEM_SYMBOL_VALUE;
markerToSet.startIndex = peekIndex - 1;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions