makeWebListLine returns the contents of a single line in a web listing. This includes the source line and the corresponding assembly.
(lineNo int, flat, cum int64, lineContents string, assembly []assemblyInstruction, reader *sourceReader, rpt *Report)
| 805 | // makeWebListLine returns the contents of a single line in a web listing. This includes |
| 806 | // the source line and the corresponding assembly. |
| 807 | func makeWebListLine(lineNo int, flat, cum int64, lineContents string, |
| 808 | assembly []assemblyInstruction, reader *sourceReader, rpt *Report) WebListLine { |
| 809 | line := WebListLine{ |
| 810 | SrcLine: lineContents, |
| 811 | Line: lineNo, |
| 812 | Flat: valueOrDot(flat, rpt), |
| 813 | Cumulative: valueOrDot(cum, rpt), |
| 814 | } |
| 815 | |
| 816 | if len(assembly) == 0 { |
| 817 | line.HTMLClass = "nop" |
| 818 | return line |
| 819 | } |
| 820 | |
| 821 | nestedInfo := false |
| 822 | line.HTMLClass = "deadsrc" |
| 823 | for _, an := range assembly { |
| 824 | if len(an.inlineCalls) > 0 || an.instruction != synthAsm { |
| 825 | nestedInfo = true |
| 826 | line.HTMLClass = "livesrc" |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | if nestedInfo { |
| 831 | srcIndent := indentation(lineContents) |
| 832 | line.Instructions = makeWebListInstructions(srcIndent, assembly, reader, rpt) |
| 833 | } |
| 834 | return line |
| 835 | } |
| 836 | |
| 837 | func makeWebListInstructions(srcIndent int, assembly []assemblyInstruction, reader *sourceReader, rpt *Report) []WebListInstruction { |
| 838 | var result []WebListInstruction |
no test coverage detected
searching dependent graphs…