** increment line number and skips newline sequence (any of ** \n, \r, \n\r, or \r\n) */
| 152 | ** \n, \r, \n\r, or \r\n) |
| 153 | */ |
| 154 | static void inclinenumber (LexState *ls) { |
| 155 | int old = ls->current; |
| 156 | lua_assert(currIsNewline(ls)); |
| 157 | next(ls); /* skip '\n' or '\r' */ |
| 158 | if (currIsNewline(ls) && ls->current != old) |
| 159 | next(ls); /* skip '\n\r' or '\r\n' */ |
| 160 | if (++ls->linenumber >= MAX_INT) |
| 161 | lexerror(ls, "chunk has too many lines", 0); |
| 162 | } |
| 163 | |
| 164 | |
| 165 | void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, |
no test coverage detected