← every case · 2000 · string forms
In Ruby, class <<self opens the class of self itself, and the << there is an operator. Read as a heredoc, it would need a line holding self alone further down, and Ruby refuses to parse a heredoc that never closes. A counter that opens one there reads every line after it as string, the comment under it included. The real heredoc further down holds an apostrophe and a line beginning with #, so a counter that reads no heredocs gets that one wrong, and the comment after it as well
| 1 | codecodecodecodecodecodecode | class Report |
| 2 | codecodecodecodecodecodecode | class <<self |
| 3 | commentscommentscommentscommentscommentscommentscomments | # the class methods |
| 4 | codecodecodecodecodecodecode | def title |
| 5 | codecodecodecodecodecodecode | 'Totals' |
| 6 | codecodecodecodecodecodecode | end |
| 7 | codecodecodecodecodecodecode | end |
| 8 | blanksblanksblanksextrablanksblanksblanks | |
| 9 | codecodecodecodecodecodecode | def body |
| 10 | codecodecodecodecodecodecode | <<TEXT |
| 11 | codecodecodecodecodecodecode | it's the body |
| 12 | codecodecodecodecodecodecode | # not a comment |
| 13 | codecodecodecodecodecodecode | TEXT |
| 14 | codecodecodecodecodecodecode | end |
| 15 | commentscommentscommentscommentscommentscommentscomments | # a real comment |
| 16 | codecodecodecodecodecodecode | end |
stringcommentthe tag around another language
reads no heredoc in Ruby, so the line of the heredoc that begins with # counts as a comment
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb
--strip-str-comments
reads no heredoc in Ruby, so the line of the heredoc that begins with # counts as a comment
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb --strip-str-comments
reads no heredoc in Ruby, so the line of the heredoc that begins with # counts as a comment
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb --docstring-as-code
codestats cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb --output json --hide timing --no-default-config --no-local --counting content
mezura cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb --output json --hide timing --no-default-config --no-local --counting region
reads no heredoc in Ruby, so the apostrophe of it's on line 11 opens a string that runs to the end of the file, and the comment on line 15 counts as code
scc --format json --no-config cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb
reads no heredoc in Ruby, so the apostrophe of it's on line 11 opens a string that runs to the end of the file, and the comment on line 15 counts as code
tokei --output json cases/2000-string_forms/2125-operator_spelled_like_a_heredoc_opener/input.rb