fix: align pilota parsing with standard grammar - #370
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #370 +/- ##
==========================================
+ Coverage 68.46% 68.77% +0.31%
==========================================
Files 89 89
Lines 25924 26190 +266
==========================================
+ Hits 17748 18012 +264
- Misses 8176 8178 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shenyj3
reviewed
Jul 27, 2026
shenyj3
previously approved these changes
Jul 29, 2026
Joshuahoky
force-pushed
the
feat/pilota-parser-grammar-misalignment
branch
from
July 29, 2026 08:32
854782f to
b0c92bd
Compare
shenyj3
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Current parser behaviour deviates from the specs Thrift IDL grammar
in numerous places, causing the parser to accept inputs that should be rejected or reject inputs that should be valid. Some of the deviations include:
Solution
Components::keyword()(ajust()followed by a non-consuming word boundary that also succeeds at end of input) and use it for every reserved wordIntConstantas('+' | '-')? (0x HexDigit+ | Digit+)with the sign kept inside the matched slice, and convert viatry_map, so out-of-range values become parse errors rather than panics andi64::MINround-trips.DoubleConstant's integer part becomesDigit*for the.5form, with the exponent-only form still requiring at least one digit.IntConstantand are range-checked intoi16with atry_map, so negative ids work and oversized ids are a diagnostic instead of a silent truncation.Scopebecomes'*' | Identifier(dots allowed, sincepy.twistedis in real-world use), which also makes a missing scope an error.just(",")instead oflist_separator.