Skip to content

Allow model to be supplied on stdin with '-'#1488

Merged
WardBrian merged 3 commits intomasterfrom
allow-model-from-stdin
Jan 10, 2025
Merged

Allow model to be supplied on stdin with '-'#1488
WardBrian merged 3 commits intomasterfrom
allow-model-from-stdin

Conversation

@WardBrian
Copy link
Copy Markdown
Member

@WardBrian WardBrian commented Jan 10, 2025

This is a small change that allows some better 'scriptability' of the compiler, e.g.

 $ cat test/integration/good/for_early_return.stan | stanc - --auto-format
functions {
  real ends() {
    for (i in 1 : 10) {
      return 1;
    }
  }
}
transformed parameters {
  real a = ends();
}

Submission Checklist

Release notes

The compiler now accepts - as a model argument, in which case it reads from standard input

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)

@WardBrian WardBrian requested a review from nhuurre January 10, 2025 14:40
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.07%. Comparing base (7d4dd50) to head (075a436).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1488      +/-   ##
==========================================
+ Coverage   90.05%   90.07%   +0.01%     
==========================================
  Files          66       66              
  Lines       10751    10759       +8     
==========================================
+ Hits         9682     9691       +9     
+ Misses       1069     1068       -1     
Files with missing lines Coverage Δ
src/frontend/Errors.ml 100.00% <100.00%> (ø)
src/frontend/Pretty_print_prog.ml 82.85% <ø> (ø)
src/stanc/CLI.ml 98.09% <100.00%> (+0.05%) ⬆️
src/stanc/stanc.ml 86.66% <100.00%> (+1.66%) ⬆️

... and 1 file with indirect coverage changes

@WardBrian WardBrian merged commit f13066b into master Jan 10, 2025
@WardBrian WardBrian deleted the allow-model-from-stdin branch January 10, 2025 19:39
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