← every case · 6000 · another language inside the file
one file, three languages: the script and style blocks are counted with their own symbols, so the js comment and the css comment are comments although the Vue file holding them has neither symbol
| 1 | codecodecodecodecodecode | <template> |
| 2 | codecodecodecodecodecode HTML | <p class="a">it's fine</p> |
| 3 | commentscommentscommentscommentscommentscomments HTML | <!-- a template comment --> |
| 4 | codecodecodecodecodecode | </template> |
| 5 | codecodecodecodecodecode | <script> |
| 6 | comments JavaScriptcomments JavaScriptcomments JavaScriptcomments JavaScriptcomments JavaScriptcomments JavaScript | // a js comment |
| 7 | blanks JavaScriptblanks JavaScriptextra JavaScriptblanks JavaScriptblanks JavaScriptblanks JavaScript | |
| 8 | code JavaScriptcode JavaScriptcode JavaScriptcode JavaScriptcode JavaScriptcode JavaScript | var x = "</p>"; |
| 9 | codecodecodecodecodecode | </script> |
| 10 | codecodecodecodecodecode | <style> |
| 11 | comments CSScomments CSScomments CSScomments CSScomments CSScomments CSS | /* a css comment */ |
| 12 | code CSScode CSScode CSScode CSScode CSScode CSS | .a { color: red; } |
| 13 | codecodecodecodecodecode | </style> |
stringcommentthe tag around another language
the file is counted as one language from beginning to end, and every number comes out right only because the symbols it applies to a vue file already cover the markup, the js and the css comments, while neither block is named
cloc --json cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue
--strip-str-comments
the file is counted as one language from beginning to end, and every number comes out right only because the symbols it applies to a vue file already cover the markup, the js and the css comments, while neither block is named
cloc --json cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue --strip-str-comments
the file is counted as one language from beginning to end, and every number comes out right only because the symbols it applies to a vue file already cover the markup, the js and the css comments, while neither block is named
cloc --json cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue --docstring-as-code
mezura cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue --output json --hide timing --no-default-config --no-local --counting content
mezura cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue --output json --hide timing --no-default-config --no-local --counting region
the file is counted as one language from beginning to end, so neither block is found. The totals come out right because Vue's own table carries all three comment symbols and only the double quote as a string
scc --format json cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue
the apostrophe of "it's" opens a string, and the template comment under it is counted as code
tokei --output json cases/6000-another_language_inside_the_file/6090-vue_blocks_count_as_their_own_languages/input.vue