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

Function parse_tuple

js/SCASTPY.js:583–604  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

581 }
582 }
583 function parse_tuple(){
584 var n=input.next()
585 var end=')'
586 var body=[]
587 var poi={line:n.poi.line,start:n.poi.start}
588 var str=""
589 while(input.peek().value!=end){
590 let nn=input.next()
591 if(is_punc('['))body.push(parse_list())
592 if(is_punc('('))body.push(parse_tuple())
593 if(is_punc('{'))body.push(parse_object())
594 str+=nn.value
595 body.push(nn)
596 }
597 input.next()
598 return {
599 type:"TupleExpression",
600 value:str,
601 body:body,
602 poi:poi
603 }
604 }
605 function parse_object(){
606 var n=input.next()
607 var end='}'

Callers 3

parse_listFunction · 0.70
parse_objectFunction · 0.70
parse_expressionFunction · 0.70

Calls 3

is_puncFunction · 0.70
parse_listFunction · 0.70
parse_objectFunction · 0.70

Tested by

no test coverage detected