Skip to content

Fixed raw struct name identifier parsing#402

Merged
juntyr merged 4 commits into
ron-rs:masterfrom
juntyr:401-raw-identifiers
Sep 7, 2022
Merged

Fixed raw struct name identifier parsing#402
juntyr merged 4 commits into
ron-rs:masterfrom
juntyr:401-raw-identifiers

Conversation

@juntyr

@juntyr juntyr commented Aug 20, 2022

Copy link
Copy Markdown
Member

Fixes #401

  • adds documentation about valid identifiers to the grammar
  • checks identifier validity upon serialisation
  • fix struct name parsing to support raw identifiers

@torkleyy Deserialisation currently does NOT validate expected identifiers, so one could get an error saying found "World" but expected "Hello World" which has absolutely no user-side fix if you don't control the data structure you're deserialising into. I could specialise the error messages to add a note if an invalid identifier was expected, but that might clutter the code base.

  • I've included my change in CHANGELOG.md

@juntyr juntyr requested a review from torkleyy August 20, 2022 07:47
Comment thread tests/401_raw_identifier.rs
@codecov-commenter

codecov-commenter commented Aug 21, 2022

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 79.37063% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.74%. Comparing base (21833a8) to head (39d404e).
⚠️ Report is 117 commits behind head on master.

Files with missing lines Patch % Lines
src/error.rs 36.73% 31 Missing ⚠️
src/parse.rs 65.95% 16 Missing ⚠️
src/de/mod.rs 72.72% 12 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #402      +/-   ##
==========================================
- Coverage   79.52%   78.74%   -0.79%     
==========================================
  Files          50       51       +1     
  Lines        6419     6737     +318     
==========================================
+ Hits         5105     5305     +200     
- Misses       1314     1432     +118     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@juntyr

juntyr commented Sep 7, 2022

Copy link
Copy Markdown
Member Author

@torkleyy Can I merge this PR?

@torkleyy torkleyy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, looks good to me 👍

@juntyr juntyr merged commit a63b3c8 into ron-rs:master Sep 7, 2022
@juntyr juntyr deleted the 401-raw-identifiers branch September 7, 2022 16:00
juntyr added a commit to juntyr/ron that referenced this pull request Aug 15, 2023
* Fixed raw struct name identifier parsing

* Added more tests, raw identifier suggestion error, and invalid identifier error formatting

* Even more empty identifier tests
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.

Raw struct names cannot be deserialised

3 participants