()
| 415 | |
| 416 | } |
| 417 | function parse_function(){ |
| 418 | input.next() |
| 419 | var r={ |
| 420 | type:'FunctionDefine', |
| 421 | value:input.peek().value, |
| 422 | poi:{start:input.peek().poi.start,line:input.peek().poi.line}, |
| 423 | } |
| 424 | input.next() |
| 425 | if(is_punc('('))r.arguments=parse_arguments() |
| 426 | if(is_op('->')){ |
| 427 | input.next() |
| 428 | r.return=input.peek() |
| 429 | while(!is_sp(':'))input.next(); |
| 430 | } |
| 431 | if(is_sp(':'))r.body=parse_block().body |
| 432 | for(let arg of r.arguments.body){ |
| 433 | if(arg.value=='self'&&isclass){ |
| 434 | r.type='MethodDefine' |
| 435 | break |
| 436 | } |
| 437 | } |
| 438 | // console.log('function',r) |
| 439 | return r |
| 440 | } |
| 441 | function parse_class(){ |
| 442 | input.next() |
| 443 | var r={ |
no test coverage detected