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

Function parse_class

js/SCASTPY.js:441–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439 return r
440 }
441 function parse_class(){
442 input.next()
443 var r={
444 type:'ClassDefine',
445 value:input.peek().value,
446 poi:{start:input.peek().poi.start,line:input.peek().poi.line},
447 extends:[]
448 }
449 input.next()
450 if(is_punc('(')){
451 while(!is_punc(')')){
452 let p=input.next()
453 if(is_id()){
454 r.extends.push(input.peek())
455 }
456 }
457 skip_punc(')')
458 }
459 isclass=true
460 if(is_sp(':'))r.body=parse_block(true).body
461 console.log('class',r,isclass)
462 isclass=false
463 return r
464 }
465 function parse_condition() {
466 var r={
467 type: "Condition",

Callers 1

parse_statementFunction · 0.70

Calls 5

is_puncFunction · 0.70
is_idFunction · 0.70
skip_puncFunction · 0.70
is_spFunction · 0.70
parse_blockFunction · 0.70

Tested by

no test coverage detected