DOT3_RGB[A] cannot be used in a Blend String

The blend string compiler checks that the syntax of a function name is
[A-Za-z_]*, preventing the use of DOT3_RGB[A].

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Samuel Degrande 2009-09-02 16:27:22 +01:00 committed by Emmanuele Bassi
parent e72747cbb8
commit 0b4837d8a2

View File

@ -482,6 +482,12 @@ is_symbol_char (const char c)
return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE; return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE;
} }
static gboolean
is_alphanum_char (const char c)
{
return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE;
}
static gboolean static gboolean
parse_argument (const char *string, /* original user string */ parse_argument (const char *string, /* original user string */
const char **ret_p, /* start of argument IN:OUT */ const char **ret_p, /* start of argument IN:OUT */
@ -845,7 +851,7 @@ _cogl_blend_string_compile (const char *string,
case PARSER_STATE_SCRAPING_FUNCTION_NAME: case PARSER_STATE_SCRAPING_FUNCTION_NAME:
if (*p != '(') if (*p != '(')
{ {
if (!is_symbol_char (*p)) if (!is_alphanum_char (*p))
{ {
error_string = "non alpha numeric character in function" error_string = "non alpha numeric character in function"
"name"; "name";