You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like there are two issues here. The first is that you would like a way to get an IonElement tree from a string, and the second is that you want to be able to serialize/deserialize the "metas".
Creating an IonElement tree from a string
This is already possible using the loadSingleElement function, found here. For example:
loadSingleElement("(sexp (annotation::data))")
This is the equivalent to calling IonSystem::singleValue(...) using ion-java to get an IonValue.
Deserializing Metas
The "metas" are not actually part of the Ion data format, and there is no support for metas in IonValue. To get the location metadata for IonElement, you can do this:
That will include the actual location in the metas, so the symbol data will have metas with a location of line:1,column:8 (because the annotation:: starts at column 8).
Currently IonElement doesn't support creation from String that contain annotation & meta, it has to be created like this:
Instead of above, something like this would be much simpler:
parseFromString("(sexp (annotation::data meta={line:1,column:23}))")
This ability is present for
IonValue
, it would be great if we could have the same forIonElement
.Thanks!
The text was updated successfully, but these errors were encountered: