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

Delete --replacement and use template for both failure and success instead #79

Merged
merged 8 commits into from
Jan 16, 2019

Conversation

kyuridenamida
Copy link
Owner

@kyuridenamida kyuridenamida commented Jan 15, 2019

--replacementを廃止しました。
今後はreplacementの代わりとなるものをtemplateに包含してください。
便利フラグとしてデフォルトのジェネレーターにprediction_successをテンプレート引数として含むようにしましたのでご利用ください。このフラグは入力解析に失敗したときFalse、そうでないときTrueとなっています。
prediction_success=Trueのときinput_part, actual_arguments, formal_argumentsが存在します。

問題文からのMOD,YES,NO等の抽出は入力解析とは独立に実行されるので、prediction_successがFalseのときでもそれらが存在する可能性があります。

#include <bits/stdc++.h>
using namespace std;

{% if mod %}
const long long MOD = {{ mod }};
{% endif %}
{% if yes_str %}
const string YES = "{{ yes_str }}";
{% endif %}
{% if no_str %}
const string NO = "{{ no_str }}";
{% endif %}

{% if prediction_success %}
void solve({{ formal_arguments }}){

}
{% endif %}

int main(){
    {% if prediction_success %}
    {{input_part}}
    solve({{ actual_arguments }});
    {% else %}
    // Failed to predict input format
    {% endif %}
    return 0;
}

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #79 into master will decrease coverage by 0.06%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
- Coverage    91.5%   91.44%   -0.07%     
==========================================
  Files          38       38              
  Lines        1790     1800      +10     
==========================================
+ Hits         1638     1646       +8     
- Misses        152      154       +2
Impacted Files Coverage Δ
atcodertools/codegen/models/code_gen_args.py 100% <100%> (ø) ⬆️
...s/fmtprediction/models/format_prediction_result.py 100% <100%> (ø) ⬆️
atcodertools/codegen/template_engine.py 100% <100%> (ø) ⬆️
atcodertools/fileutils/create_contest_file.py 100% <100%> (ø) ⬆️
atcodertools/codegen/code_style_config.py 97.05% <100%> (+0.08%) ⬆️
atcodertools/codegen/code_generators/cpp.py 96.29% <100%> (+0.06%) ⬆️
atcodertools/tools/envgen.py 80% <90.47%> (-0.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c7a649...6bca748. Read the comment docs.

@kyuridenamida kyuridenamida merged commit 06ad3cf into master Jan 16, 2019
@kyuridenamida kyuridenamida added this to the 1.1.0 milestone Jan 16, 2019
@kyuridenamida kyuridenamida deleted the issue/72 branch April 17, 2021 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants