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

Function parse_id

js/SCAST.js:526–553  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

524 else return until_next_kw();
525 }
526 function parse_id(){
527 var prevv=input.prev()
528 var n = input.next();
529 if(is_punc('(')){
530 var r={
531 type:"CallExpression",
532 value:n.value,
533 poi:{line:n.poi.line,start:n.poi.start},
534 body:[parse_arguments()],
535 callee:prevv
536 }
537 if(is_punc('{')){
538 r.type="FunctionDefine"
539 r.body=parse_block().body
540 }
541 return r
542 }else if(is_op('=')){//Variable
543 var r={
544 type:"Variable",
545 value:n.value,
546 poi:{line:n.poi.line,start:n.poi.start},
547 body:[parse_variable(n.value)]
548 }
549 return r;
550 }else{
551 return n;
552 }
553 }
554 function parse_new(){
555 var n=input.next();
556 if(is_id()){

Callers 1

parse_expressionFunction · 0.70

Calls 5

is_puncFunction · 0.70
parse_argumentsFunction · 0.70
parse_blockFunction · 0.70
is_opFunction · 0.70
parse_variableFunction · 0.70

Tested by

no test coverage detected