MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / parse_condition

Function parse_condition

js/SCAST.js:408–441  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406 return r
407 }
408 function parse_condition() {
409 var r={
410 type: "Condition",
411 poi:{line:input.peek().poi.line,start:input.peek().poi.start},
412 value:'',
413 body:[]
414 }
415 skip_punc("(");
416 while (!is_punc(")")) {
417 let n=null;
418 if(is_id()){
419 let prevv=input.prev().value
420 let np=input.peek().value
421 r.value+=np+' '
422 n=input.next()
423 if(is_punc('(')){
424 r.body.push({
425 type:"CallExpression",
426 value:n.value,
427 poi:{line:n.poi.line,start:n.poi.start},
428 body:[parse_arguments()],
429 callee:prevv
430 })
431 }
432 continue
433 }else{
434 n=input.next()
435 }
436 r.value+=n.value+' ';
437 r.body.push(n)
438 }
439 skip_punc(")");
440 return r
441 }
442 function parse_loop(){
443 var n = input.next();
444 if(is_punc('(')){

Callers 2

parse_loopFunction · 0.70
parse_ifFunction · 0.70

Calls 4

skip_puncFunction · 0.70
is_puncFunction · 0.70
is_idFunction · 0.70
parse_argumentsFunction · 0.70

Tested by

no test coverage detected