MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / declaration

Function declaration

packages/core/css/lib/parse/index.ts:214–238  ·  view source on GitHub ↗

* Parse declaration.

()

Source from the content-addressed store, hash-verified

212 */
213
214 function declaration() {
215 var pos = position();
216
217 // prop
218 var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
219 if (!prop) return;
220 prop = trim(prop[0]);
221
222 // :
223 if (!match(/^:\s*/)) return error("property missing ':'");
224
225 // val
226 var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
227
228 var ret = pos({
229 type: 'declaration',
230 property: prop.replace(commentre, ''),
231 value: val ? trim(val[0]).replace(commentre, '') : '',
232 });
233
234 // ;
235 match(/^[;\s]*/);
236
237 return ret;
238 }
239
240 /**
241 * Parse declarations.

Callers 3

declarationsFunction · 0.85
atpageFunction · 0.85
atfontfaceFunction · 0.85

Calls 5

trimFunction · 0.85
replaceMethod · 0.80
positionFunction · 0.70
matchFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected