lua-users home
lua-l archive

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

Neha wrote:
How do I tokenize a lua string? if someone could point me in the rght direction, it would be very helpful.

Do you mean a string of Lua source-code? Try ltokens[1], Rici's lexer[2] or my lexer[3]. Or do you mean a "string literal" used in Lua source-code? The manual[4] explains string literals very well, and any of the above lexers should get you started. If neither of those, I don't know.

 - Peter Odding

    based on the actual Lua lexer (IIRC)

    "code and configuration to lex and colourise Lua"
    written in pure Lua (IIRC), so most portable

    uses LPeg, see

    "Literal strings can be delimited by ..."