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

Fix cursor location for displaying compiler errors and info. #2136

Merged
merged 1 commit into from
Aug 5, 2017

Conversation

jemc
Copy link
Member

@jemc jemc commented Aug 5, 2017

In PR #2039 (explicit partial calls), one of the changes I made was
to make it so that the cursor, when reporting on an error for a token
that was missing (like the missing '?' for an explicit partial call),
would be placed under the token to the left of where the missing
token should be, instead of under the token to the right (which
was often on the next line).

However, in doing this, I accidentally made it so that many other
(non-missing) tokens were also being reported one token to the left
instead of under the actual token itself. For example:

main.pony:5:5: can't find declaration of 'present'
    until present end
    ^

Which should be displayed as:

main.pony:5:5: can't find declaration of 'present'
    until present end
          ^

This PR fixes the accidental breakage, while retaining the desired
behaviour introduced in PR #2039, so that the "explicit partial calls"
migration script will still work correctly. Now all tokens should be
reported in the correct position when displaying errors.

In PR #2039 (explicit partial calls), one of the changes I made was
to make it so that the cursor, when reporting on an error for a token
that was missing (like the missing '?' for an explicit partial call,
would be placed under the token to the left of where the missing
token should be, instead of under the token to the right (which
was often on the next line).

However, in doing this, I accidentally made it so that many other
(non-missing) tokens were also being reported one token to the left
instead of under the actual token itself. For example:

    main.pony:5:5: can't find declaration of 'present'
        until present end
        ^

Which should be displayed as:

    main.pony:5:5: can't find declaration of 'present'
        until present end
              ^

This PR fixes the accidental breakage, while retaining the desired
behaviour introduced in PR #2039. Now all tokens should be reported
in the correct position when displaying errors.
@jemc jemc added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Aug 5, 2017
@jemc jemc mentioned this pull request Aug 5, 2017
@SeanTAllen SeanTAllen merged commit 728ec11 into master Aug 5, 2017
ponylang-main added a commit that referenced this pull request Aug 5, 2017
@SeanTAllen SeanTAllen deleted the fix/deferrable-token-pos branch August 5, 2017 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants