Update parsing code for ITF8 and LTF8 #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I used AI (claude) to rewrite the parseItf8 and parseLtf8 functions. They outputted code that was easier to read, more systematic, and more correct:
It fixed a bug with ltf8 parsing
There is not very much usage of ltf8 in the whole spec, so this finding is probably fairly low impact, but it does relate to assigning uniqueId to each record (the 'record counter' is an example of this)
Related to ongoing attempts to use AI code
Example of my dialog with the AI. I used avante.nvim to prompt it to fill in an empty function named parseLtf8, and it found we already had on in the file (it provides the whole file as context) and adapted it. then i told it to not use our existing code for bytes 8 and 9, which switched to using long.js, but is probably best just done with the manual bit twiddling for consistency