On 2025-11-13 16:29, Luiz Henrique de Figueiredo wrote:
> You may want to avoid the numerical token values; they may change in
> different versions of Lua.
> Here is a patch that does that:
>
> % diff Dump.lua new.lua
> 23,24c23,24
> < local NameTypeId = 291
> < local StringTypeId = 292
> ---
> > local NameTypeId = "<name>"
> > local StringTypeId = "<string>"
> 75c75
> < Process(token, value)
> ---
> > Process(text, value)
Thanks for feedback, lhf!
I've spent another 30 minutes reviewing code and updating gist's snippet.
Now there are no integer constants and somewhat better names.
So we can rely that third argument FILTER() receives is string,
and if it is in angle brackets it can be only "<file>", "<string>",
"<name>", "<number>" or "<eof>"?
-- Martin