Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ion_reader_get_value_position for fetching the line & column of the current value from a text reader. #278

Merged
merged 8 commits into from
Aug 24, 2022

Conversation

dlurton
Copy link
Contributor

@dlurton dlurton commented Jan 26, 2022

The position of the current value is the first character of its Ion-text representation or (if present) the first character of the first annotation. This information is useful for reporting semantic errors to end-users when Ion-text files are used to express domain-specific language (DSL) scripts.

Also fixes a bug causing the current line number from being set to zero after every call to ion_reader_next.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dlurton dlurton requested review from tgregg and rgantt January 26, 2022 07:28
Copy link
Contributor

@tgregg tgregg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a couple minor comments and test suggestions.

ionc/include/ionc/ion_reader.h Outdated Show resolved Hide resolved
ionc/include/ionc/ion_reader.h Outdated Show resolved Hide resolved
ionc/ion_reader_text.c Show resolved Hide resolved
ionc/ion_reader.c Outdated Show resolved Hide resolved
ionc/ion_reader_text.c Show resolved Hide resolved
test/test_ion_text.cpp Show resolved Hide resolved
test/test_ion_text.cpp Show resolved Hide resolved
test/test_ion_text.cpp Outdated Show resolved Hide resolved
test/test_ion_text.cpp Outdated Show resolved Hide resolved
test/test_ion_text.cpp Show resolved Hide resolved
ionc/include/ionc/ion_reader.h Show resolved Hide resolved
ionc/ion_reader_text.c Show resolved Hide resolved
ionc/ion_reader_impl.h Show resolved Hide resolved
ionc/ion_reader.c Outdated Show resolved Hide resolved
ionc/ion_reader_text.c Show resolved Hide resolved
Copy link
Contributor

@tgregg tgregg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved the comments that are addressed; I think my comments on the tests are still actionable.

@dlurton
Copy link
Contributor Author

dlurton commented Feb 3, 2022

I resolved the comments that are addressed; I think my comments on the tests are still actionable.

Yes, was still working on this. Have pushed another commit a few minutes ago.

@dlurton dlurton requested a review from tgregg February 3, 2022 17:44
tgregg
tgregg previously approved these changes Feb 4, 2022
Copy link
Contributor

@tgregg tgregg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

ionc/include/ionc/ion_reader.h Show resolved Hide resolved
ionc/include/ionc/ion_reader.h Outdated Show resolved Hide resolved
@dlurton dlurton merged commit cb246ea into master Aug 24, 2022
@dlurton dlurton deleted the add-pos branch August 24, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants