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

Function parse_new

js/SCAST.js:554–582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

552 }
553 }
554 function parse_new(){
555 var n=input.next();
556 if(is_id()){
557 var r={
558 type:"NewExpression",
559 value:input.peek().value,
560 poi:{line:n.poi.line,start:n.poi.start},
561 }
562 var nn=input.next()
563 if(is_punc('(')){
564 r.body=[parse_arguments()]
565 return r;
566 }else if(input.peek().value=='<'){
567 r.T=input.next()
568 return r;
569 }else if(is_sp('.')){
570 return parse_new()
571 }else if(is_punc('{')){//c#
572 r.block=parse_block()
573 return r
574 }else{
575 // console.warn("parse new",input.peek());
576 return nn;
577 }
578 }else{
579 console.warn("parse new",input.peek());
580 return n
581 }
582 }
583 function parse_expression(){
584 if (is_punc("("))return parse_arguments();
585 else if (is_punc("{")) return parse_block();

Callers 2

parse_variableFunction · 0.70
parse_expressionFunction · 0.70

Calls 5

is_idFunction · 0.70
is_puncFunction · 0.70
parse_argumentsFunction · 0.70
is_spFunction · 0.70
parse_blockFunction · 0.70

Tested by

no test coverage detected