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

feat(core): relax reserved property names #581

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

mttrbrts
Copy link
Member

@mttrbrts mttrbrts commented Jan 5, 2023

Partially addresses Issue #572

This PR relaxes the parsing and core API restrictions on identifier names. The following names are now permitted:

  • false
  • true
  • null

Changes

  • Adds explicit test cases which give good coverage of valid & invalid identifiers
  • Changes Parser rules to allow NullLiteral and BooleanLiterals as identifiers
  • Removes the explicit reserved keyword check in the core API. This was only introduced recently to address a ReDOS limitation when generating sample JSON files regexes (negative lookahead was not supported). BREAKING CHANGE(core): limit regex to ReDoS safe patterns #484
  • Upgrades Unicode character categories to Unicode 15.0.0

Flags

  • I believe that this should be considered a non-breaking change, as it loosens the constraints on identifiers.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

@mttrbrts mttrbrts marked this pull request as ready for review January 5, 2023 11:02
@mttrbrts mttrbrts requested review from a team and stefanblaginov January 5, 2023 11:02
@mttrbrts
Copy link
Member Author

@jonathan-casey

@jonathan-casey jonathan-casey self-requested a review January 17, 2023 10:42
Copy link
Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

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

I assume imposing the identifier constraints on the AST will be in a follow-up PR?

@mttrbrts
Copy link
Member Author

I assume imposing the identifier constraints on the AST will be in a follow-up PR?

Yes, that's right

@mttrbrts mttrbrts merged commit 3dd241d into accordproject:main Jan 17, 2023
@mttrbrts mttrbrts deleted the mr-identifier-regex branch January 17, 2023 13:56
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