()
| 457 | } |
| 458 | } |
| 459 | function parse_if(){ |
| 460 | var n = input.next(); |
| 461 | var r={ |
| 462 | type:"IfStatement", |
| 463 | poi:{line:n.poi.line,start:n.poi.start}, |
| 464 | value:n.value, |
| 465 | } |
| 466 | if(is_kw("if")){ |
| 467 | r.value='elif' |
| 468 | input.next() |
| 469 | } |
| 470 | if(is_punc('(')){ |
| 471 | r.condition=parse_condition() |
| 472 | if(is_punc('{')){ |
| 473 | r.body=parse_block().body |
| 474 | }else{//if(condition)express without block |
| 475 | r.body=[until_next_kw()] |
| 476 | return r |
| 477 | } |
| 478 | return r |
| 479 | } |
| 480 | if(is_punc('{'))r.body=parse_block().body//else |
| 481 | return r |
| 482 | } |
| 483 | |
| 484 | function until_next_kw(){ |
| 485 | let _body=[] |
no test coverage detected