lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Aug 30, 2011 at 3:48 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> line information, just count the number of newlines until the current
> position.)

For example, have a look at Peter Odding's Lua lexer at
http://lua-users.org/wiki/LpegRecipes, in particular the function sync
which is called for tokens that may contain newlines and updates the
line number.

steve d.