+added a customizable identifier alias macro for lambda.

This commit is contained in:
Wang Renxin 2017-06-17 20:46:06 +08:00
parent e25bb710c2
commit d5aa1867ee
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,6 @@
Jun. 17 2017
Added a customizable identifier alias macro for lambda
Jun. 10 2017 Jun. 10 2017
Fixed a processing bug with the ELSE statement, thanks to yukini3 for pointing it out Fixed a processing bug with the ELSE statement, thanks to yukini3 for pointing it out
Avoided warnings with some compilers Avoided warnings with some compilers

View File

@ -2124,6 +2124,9 @@ MBCONST static const _func_t _core_libs[] = {
#ifdef MB_ENABLE_LAMBDA #ifdef MB_ENABLE_LAMBDA
{ "LAMBDA", _core_lambda }, { "LAMBDA", _core_lambda },
# ifdef MB_ANOTHER_LAMBDA
{ MB_ANOTHER_LAMBDA, _core_lambda },
# endif /* MB_ANOTHER_LAMBDA */
#endif /* MB_ENABLE_LAMBDA */ #endif /* MB_ENABLE_LAMBDA */
#ifdef MB_ENABLE_ALLOC_STAT #ifdef MB_ENABLE_ALLOC_STAT
@ -4808,6 +4811,14 @@ static bool_t _is_numeric_char(char c) {
/* Determine whether a character is identifier char */ /* Determine whether a character is identifier char */
static bool_t _is_identifier_char(char c) { static bool_t _is_identifier_char(char c) {
#if defined MB_ENABLE_LAMBDA && defined MB_ANOTHER_LAMBDA
char* p = MB_ANOTHER_LAMBDA;
while(*p) {
if(c == *p) return true;
++p;
}
#endif /* MB_ENABLE_LAMBDA && MB_ANOTHER_LAMBDA */
return ( return (
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
(c == '_') || (c == '_') ||