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

use tabs to position error message cursor when appropriate #1414

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

nhuurre
Copy link
Collaborator

@nhuurre nhuurre commented Mar 25, 2024

On error, stanc prints the problematic source line and a caret that points to the horizontal location of the error but if the source line contains tabs instead of spaces the caret was at the wrong location.
A simple fix is to duplicate the tabs from the source to the line that contains the caret.

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here:
    • OR, no user-facing changes were made

Copyright and Licensing

Copyright holder: Niko Huurre

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@nhuurre nhuurre requested a review from WardBrian March 25, 2024 18:27
Copy link
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

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

Thanks!

@WardBrian WardBrian merged commit e1a23f3 into stan-dev:master Mar 25, 2024
1 check passed
@nhuurre nhuurre deleted the fix/print-tab-error branch March 25, 2024 18:32
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