Implement the "list" command of the Lua debugger. If around is 0 * the whole file is listed, otherwise only a small portion of the file * around the specified line is shown. When a line number is specified * the amount of context (lines before/after) is specified via the * 'context' argument. */
| 2190 | * the amount of context (lines before/after) is specified via the |
| 2191 | * 'context' argument. */ |
| 2192 | void ldbList(int around, int context) { |
| 2193 | int j; |
| 2194 | |
| 2195 | for (j = 1; j <= ldb.lines; j++) { |
| 2196 | if (around != 0 && abs(around-j) > context) continue; |
| 2197 | ldbLogSourceLine(j); |
| 2198 | } |
| 2199 | } |
| 2200 | |
| 2201 | /* Append a human readable representation of the Lua value at position 'idx' |
| 2202 | * on the stack of the 'lua' state, to the SDS string passed as argument. |
no test coverage detected