stan-dev / stanc3

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

Handle Lexing.position <-> Location.t conversions in Preprocessor #1320

Closed nhuurre closed 1 year ago

nhuurre commented 1 year ago

Stateful alternative to #1310 .

With this include_from locations are cached in Preprocessor and we don't need Location.of_string_opt at all.

Submission Checklist

Release notes

Copyright and Licensing

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)

codecov[bot] commented 1 year ago

Codecov Report

Merging #1320 (62dcb6b) into master (f2a65c8) will decrease coverage by 0.03%. The diff coverage is 100.00%.

:exclamation: Current head 62dcb6b differs from pull request most recent head 234dd5f. Consider uploading reports for the commit 234dd5f to get more accurate results

@@            Coverage Diff             @@
##           master    #1320      +/-   ##
==========================================
- Coverage   88.79%   88.76%   -0.03%     
==========================================
  Files          64       64              
  Lines        9853     9821      -32     
==========================================
- Hits         8749     8718      -31     
+ Misses       1104     1103       -1     
Impacted Files Coverage Δ
src/middle/Location.ml 95.00% <ø> (-1.16%) :arrow_down:
src/middle/Location_span.ml 90.00% <ø> (-3.34%) :arrow_down:
src/frontend/Input_warnings.ml 82.35% <100.00%> (-2.65%) :arrow_down:
src/frontend/Parse.ml 85.29% <100.00%> (ø)
src/frontend/Preprocessor.ml 96.92% <100.00%> (+0.84%) :arrow_up: