Skip to content

Preparation for location aware diagnostics in the compiler #321

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

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 22, 2022

Changes for swiftlang/swift#42583

Moving libswiftLexRegexLiteral() and libswiftParseRegexLiteral() to the compiler repository because these functions are basically just bridging the compiler to the actual lexing/parsing function.

  • Make some Lexing error APIs public.
  • Make LocatedErrorProtocol public and expose the location property
  • Shift the location of LocatedError in parseWithDelimiters so the client can get the valid string indices of the passed-in literal string.

@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2022

@swift-ci please test

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

Overall LGTM but get a check from @hamishknight

@milseman
Copy link
Member

And make sure the cherry-picking aligns with the compiler-side, ideally avoiding lock-step or integration risk

Moving `libswiftLexRegexLiteral()` and `libswiftParseRegexLiteral()` to
the compiler repository because these functions are basically just
briding the compiler to the actual lexing/parsing function.

 * Make some Lexing error APIs public.
 * Make LocatedErrorProtocol public and expose the `location` property
 * Shift the location of `LocatedError` in `parseWithDelimiters` so the
   client can get the valid string indices of the passed-in literal string.
@rintaro rintaro force-pushed the diagnostic-swiftcompiler branch from d17e37e to 89b80bf Compare April 22, 2022 18:27
@rintaro
Copy link
Member Author

rintaro commented Apr 22, 2022

@swift-ci Please test

@rintaro rintaro merged commit 06f40f6 into swiftlang:main Apr 22, 2022
@rintaro rintaro deleted the diagnostic-swiftcompiler branch April 22, 2022 19:00
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.

3 participants