(tag: SourceTagEntry, locationData: FullLocationData, sourceLines: string[])
| 179 | |
| 180 | // e.g. ">>> for-loop update (i = i + 1)" |
| 181 | function tagDescription(tag: SourceTagEntry, locationData: FullLocationData, sourceLines: string[]): string { |
| 182 | switch (tag.kind) { |
| 183 | case SourceTagKind.LOCKTIME_GUARD: |
| 184 | return '>>> tx.locktime guard (auto-injected)'; |
| 185 | case SourceTagKind.PARAMETER_VALIDATION: { |
| 186 | const parameter = deriveSourceText(tag, locationData, sourceLines); |
| 187 | return `>>> parameter type check${parameter ? ` (${parameter})` : ''}`; |
| 188 | } |
| 189 | case SourceTagKind.SCOPE_CLEANUP: |
| 190 | return '>>> scope cleanup'; |
| 191 | case SourceTagKind.LOOP_CONDITION: |
| 192 | return '>>> loop condition check'; |
| 193 | case SourceTagKind.FOR_UPDATE: |
| 194 | default: |
| 195 | return `>>> for-loop update (${deriveSourceText(tag, locationData, sourceLines)})`; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | function deriveIndent(headerLine: number, sourceLines: string[]): string { |
| 200 | const bodyLine = sourceLines.slice(headerLine).find((l) => l.trim().length > 0); |
no test coverage detected