lua-users home
lua-l archive

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

Luiz Henrique de Figueiredo wrote:
>> (I don't know if a token filter can distinguish between the two, but
>> that would be a nice addition if it doesn't).
> It can't because, by definition, it seems strings *after* the lexer
> has turned text into tokens. All strings are the same, regardless of
> what text form was used to define them. --lhf 

Would it be computationally expensive to have the tokenizer generate
three different tokens (maybe more if you want to distinguish [[]] from
[=[]=]), and just have the parser treat them equally ? In plain Lua this
would have no purpose, but in a token filtered Lua it could be useful
like in that translation case.