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. */
| 2213 | * the amount of context (lines before/after) is specified via the |
| 2214 | * 'context' argument. */ |
| 2215 | void ldbList(int around, int context) { |
| 2216 | int j; |
| 2217 | |
| 2218 | for (j = 1; j <= ldb.lines; j++) { |
| 2219 | if (around != 0 && abs(around-j) > context) continue; |
| 2220 | ldbLogSourceLine(j); |
| 2221 | } |
| 2222 | } |
| 2223 | |
| 2224 | /* Append a human readable representation of the Lua value at position 'idx' |
| 2225 | * on the stack of the 'lua' state, to the SDS string passed as argument. |
no test coverage detected