← every case · 2000 · string forms

2120-heredoc_holding_an_apostrophe

an apostrophe inside the body of a shell heredoc. The word that ends a heredoc is chosen where it is written, so no fixed list of comment and string symbols can say what closes this one

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.sh
1codecat <<TEXT
2codeit's fine in here
3codeTEXT
4comments# a real comment
5comments# a second real comment

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask5 lines · 0 blanks · 3 code · 2 comments
it answers5 lines · 0 blanks · 3 code · 2 comments

cloc --json cases/2000-string_forms/2120-heredoc_holding_an_apostrophe/input.sh

mezura.content ✗ fails

the apostrophe opens a string and every comment under it is counted as code

the rules ask5 lines · 3 code · 2 comments · 0 extra
it answers5 lines · 5 code · 0 comments · 0 extra

mezura cases/2000-string_forms/2120-heredoc_holding_an_apostrophe/input.sh --output json --hide timing --counting content

mezura.region ✗ fails

the apostrophe opens a string and every comment under it is counted as code

the rules ask5 lines · 0 blanks · 3 code · 2 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

mezura cases/2000-string_forms/2120-heredoc_holding_an_apostrophe/input.sh --output json --hide timing --counting region

scc.default ✗ fails

the apostrophe opens a string and every comment under it is counted as code

the rules ask5 lines · 0 blanks · 3 code · 2 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

scc --format json cases/2000-string_forms/2120-heredoc_holding_an_apostrophe/input.sh

tokei.default ✗ fails

the apostrophe opens a string and every comment under it is counted as code

the rules ask5 lines · 0 blanks · 3 code · 2 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

tokei --output json cases/2000-string_forms/2120-heredoc_holding_an_apostrophe/input.sh