stan-dev / stanc3

The Stan transpiler (from Stan to C++ and beyond).
BSD 3-Clause "New" or "Revised" License
140 stars 44 forks source link

use tabs to position error message cursor when appropriate #1414

Closed nhuurre closed 6 months ago

nhuurre commented 6 months ago

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

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)