MCPcopy Index your code
hub / github.com/reactjs/react-rails / skipSingleLineComment

Function skipSingleLineComment

lib/assets/javascripts/JSXTransformer.js:2806–2846  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2804 }
2805
2806 function skipSingleLineComment() {
2807 var start, loc, ch, comment;
2808
2809 start = index - 2;
2810 loc = {
2811 start: {
2812 line: lineNumber,
2813 column: index - lineStart - 2
2814 }
2815 };
2816
2817 while (index < length) {
2818 ch = source.charCodeAt(index);
2819 ++index;
2820 if (isLineTerminator(ch)) {
2821 if (extra.comments) {
2822 comment = source.slice(start + 2, index - 1);
2823 loc.end = {
2824 line: lineNumber,
2825 column: index - lineStart - 1
2826 };
2827 addComment('Line', comment, start, index - 1, loc);
2828 }
2829 if (ch === 13 && source.charCodeAt(index) === 10) {
2830 ++index;
2831 }
2832 ++lineNumber;
2833 lineStart = index;
2834 return;
2835 }
2836 }
2837
2838 if (extra.comments) {
2839 comment = source.slice(start + 2, index);
2840 loc.end = {
2841 line: lineNumber,
2842 column: index - lineStart
2843 };
2844 addComment('Line', comment, start, index, loc);
2845 }
2846 }
2847
2848 function skipMultiLineComment() {
2849 var start, loc, ch, comment;

Callers 1

skipCommentFunction · 0.85

Calls 2

isLineTerminatorFunction · 0.85
addCommentFunction · 0.85

Tested by

no test coverage detected