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

Function skipMultiLineComment

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

Source from the content-addressed store, hash-verified

2846 }
2847
2848 function skipMultiLineComment() {
2849 var start, loc, ch, comment;
2850
2851 if (extra.comments) {
2852 start = index - 2;
2853 loc = {
2854 start: {
2855 line: lineNumber,
2856 column: index - lineStart - 2
2857 }
2858 };
2859 }
2860
2861 while (index < length) {
2862 ch = source.charCodeAt(index);
2863 if (isLineTerminator(ch)) {
2864 if (ch === 13 && source.charCodeAt(index + 1) === 10) {
2865 ++index;
2866 }
2867 ++lineNumber;
2868 ++index;
2869 lineStart = index;
2870 if (index >= length) {
2871 throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
2872 }
2873 } else if (ch === 42) {
2874 // Block comment ends with '*/' (char #42, char #47).
2875 if (source.charCodeAt(index + 1) === 47) {
2876 ++index;
2877 ++index;
2878 if (extra.comments) {
2879 comment = source.slice(start + 2, index - 2);
2880 loc.end = {
2881 line: lineNumber,
2882 column: index - lineStart
2883 };
2884 addComment('Block', comment, start, index, loc);
2885 }
2886 return;
2887 }
2888 ++index;
2889 } else {
2890 ++index;
2891 }
2892 }
2893
2894 throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
2895 }
2896
2897 function skipComment() {
2898 var ch;

Callers 1

skipCommentFunction · 0.85

Calls 3

isLineTerminatorFunction · 0.85
throwErrorFunction · 0.85
addCommentFunction · 0.85

Tested by

no test coverage detected