Re: C API to check if string is valid varible name
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: C API to check if string is valid varible name
- From: Tomas Mudrunka <mudrunka@...>
- Date: 2023年3月24日 14:21:08 +0100
Dne 2023年03月24日 12:57, Luiz Henrique de Figueiredo napsal:
Is there some C API to check wether given string is a valid
identifier?
No. But see the code for "identifier or reserved word" in llex:
https://www.lua.org/source/5.1/llex.c.html#llex
It would be really beneficial in some cases.
For instance?
I have lua embedded in system where users can define table of variables
and then write expressions to process them. However i think it would be
reasonable to have some sanity checks in place, so i don't have to
explain why formulas using variable called "TIME-MAX" are not working
:-) and stuff like that...
--
S pozdravem
Best regards
Tomáš Mudruňka - SPOJE.NET s.r.o.