MCPcopy Create free account
hub / github.com/stenciljs/core / comment

Function comment

src/compiler/style/css-parser/parse-css.ts:139–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 };
138
139 const comment = () => {
140 const pos = position();
141 if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) return null;
142
143 let i = 2;
144 while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) ++i;
145 i += 2;
146
147 if ('' === css.charAt(i - 1)) {
148 return error('End of comment missing');
149 }
150
151 const comment = css.slice(2, i - 2);
152 column += 2;
153 updatePosition(comment);
154 css = css.slice(i);
155 column += 2;
156
157 return pos({
158 type: CssNodeType.Comment,
159 comment,
160 });
161 };
162
163 const selector = () => {
164 const m: any = match(/^([^{]+)/);

Callers 1

commentsFunction · 0.85

Calls 3

positionFunction · 0.85
updatePositionFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected