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

Ensure all spans have document offsets #8039

Merged
merged 13 commits into from
Oct 19, 2023
Merged

Ensure all spans have document offsets #8039

merged 13 commits into from
Oct 19, 2023

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Oct 12, 2023

Pull Request Description

  • Validate spans during existing lexer and parser unit tests, and in enso_parser_debug.
  • Fix lost span info causing failures of updated tests.

Important Notes

  • Output of parse_all_enso_files.sh is unchanged since before Parser TS bindings #7881 (modulo libs changes since then).
  • When the parser encounters an input with the first line indented, it now creates a sub-block for lines at than indent level, and emits a syntax error (every indented block must have a parent).
  • When the parser encounters a number with a base but no digits (e.g. 0x), it now emits a Number with None in the digits field rather than a 0-length digits token.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@kazcw kazcw added the -parser label Oct 12, 2023
@kazcw kazcw self-assigned this Oct 12, 2023
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Oct 12, 2023
@kazcw kazcw linked an issue Oct 12, 2023 that may be closed by this pull request
const parseCases = [
' foo bar\n',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that space was intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was, but I've changed handling of this case. It is now a syntax error to start a file with an indented line. This is now covered by the parser unit tests.

@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Oct 16, 2023
Copy link
Member

@jdunkerley jdunkerley left a comment

Choose a reason for hiding this comment

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

Approving the libs change.

@mergify mergify bot merged commit 2edd2bd into develop Oct 19, 2023
34 checks passed
@mergify mergify bot deleted the wip/kw/parser-spans branch October 19, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-parser CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compute full (UTF16) span info in parser
5 participants