MCPcopy Create free account
hub / github.com/apache/cloudstack / primary

Function primary

tools/ngui/static/js/lib/angular.js:6270–6303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6268
6269
6270 function primary() {
6271 var primary;
6272 if (expect('(')) {
6273 primary = filterChain();
6274 consume(')');
6275 } else if (expect('[')) {
6276 primary = arrayDeclaration();
6277 } else if (expect('{')) {
6278 primary = object();
6279 } else {
6280 var token = expect();
6281 primary = token.fn;
6282 if (!primary) {
6283 throwError("not a primary expression", token);
6284 }
6285 }
6286
6287 var next, context;
6288 while ((next = expect('(', '[', '.'))) {
6289 if (next.text === '(') {
6290 primary = functionCall(primary, context);
6291 context = null;
6292 } else if (next.text === '[') {
6293 context = primary;
6294 primary = objectIndex(primary);
6295 } else if (next.text === '.') {
6296 context = primary;
6297 primary = fieldAccess(primary);
6298 } else {
6299 throwError("IMPOSSIBLE");
6300 }
6301 }
6302 return primary;
6303 }
6304
6305 function _fieldAccess(object) {
6306 var field = expect().text;

Callers 2

parserFunction · 0.85
unaryFunction · 0.85

Calls 5

expectFunction · 0.85
consumeFunction · 0.85
arrayDeclarationFunction · 0.85
objectFunction · 0.85
throwErrorFunction · 0.85

Tested by

no test coverage detected