(rout, blockname, comment=1, counter=0)
| 641 | |
| 642 | |
| 643 | def getmultilineblock(rout, blockname, comment=1, counter=0): |
| 644 | try: |
| 645 | r = rout['f2pyenhancements'].get(blockname) |
| 646 | except KeyError: |
| 647 | return |
| 648 | if not r: |
| 649 | return |
| 650 | if counter > 0 and isinstance(r, str): |
| 651 | return |
| 652 | if isinstance(r, list): |
| 653 | if counter >= len(r): |
| 654 | return |
| 655 | r = r[counter] |
| 656 | if r[:3] == "'''": |
| 657 | if comment: |
| 658 | r = '\t/* start ' + blockname + \ |
| 659 | ' multiline (' + repr(counter) + ') */\n' + r[3:] |
| 660 | else: |
| 661 | r = r[3:] |
| 662 | if r[-3:] == "'''": |
| 663 | if comment: |
| 664 | r = r[:-3] + '\n\t/* end multiline (' + repr(counter) + ')*/' |
| 665 | else: |
| 666 | r = r[:-3] |
| 667 | else: |
| 668 | errmess("%s multiline block should end with `'''`: %s\n" |
| 669 | % (blockname, repr(r))) |
| 670 | return r |
| 671 | |
| 672 | |
| 673 | def getcallstatement(rout): |
no test coverage detected