4 ms·
As a lua newb, lexing seems to be impossible since there doesn't appear to be a non kludge way to access the characters of a string in sequence. I suppose lpeg
by marktangotango 11y ago
As a lua newb, lexing seems to be impossible since there doesn't appear to be a non kludge way to access the characters of a string in sequence. I suppose lpeg is using lua's pattern matching a capture facilities behinx the scenes?
- anonymoushn 11y agostring.sub does this. I usually set __index in the string metatable to a function that lets you index strings and get the right thing.
- Houshalter 11y agoThis is exactly what lpeg is for. Lpeg is written in C.