(rout, blockname, comment=1, counter=0)
| 665 | |
| 666 | |
| 667 | def getmultilineblock(rout, blockname, comment=1, counter=0): |
| 668 | try: |
| 669 | r = rout['f2pyenhancements'].get(blockname) |
| 670 | except KeyError: |
| 671 | return |
| 672 | if not r: |
| 673 | return |
| 674 | if counter > 0 and isinstance(r, str): |
| 675 | return |
| 676 | if isinstance(r, list): |
| 677 | if counter >= len(r): |
| 678 | return |
| 679 | r = r[counter] |
| 680 | if r[:3] == "'''": |
| 681 | if comment: |
| 682 | r = '\t/* start ' + blockname + \ |
| 683 | ' multiline (' + repr(counter) + ') */\n' + r[3:] |
| 684 | else: |
| 685 | r = r[3:] |
| 686 | if r[-3:] == "'''": |
| 687 | if comment: |
| 688 | r = r[:-3] + '\n\t/* end multiline (' + repr(counter) + ')*/' |
| 689 | else: |
| 690 | r = r[:-3] |
| 691 | else: |
| 692 | errmess(f"{blockname} multiline block should end with `'''`: {repr(r)}\n") |
| 693 | return r |
| 694 | |
| 695 | |
| 696 | def getcallstatement(rout): |
no test coverage detected
searching dependent graphs…