Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index bb1ecea6a24..727b1e44931 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -391,7 +391,9 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop
{
int a = 0;
- /* list from http://docs.python.org/py3k/reference/lexical_analysis.html#keywords */
+ /* list is from...
+ * ", ".join(['"%s"' % kw for kw in __import__("keyword").kwlist if kw not in {"False", "None", "True"}])
+ */
static const char *kwlist[] = {
/* "False", "None", "True", */
"and", "as", "assert", "break",
@@ -631,7 +633,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
if (DefRNA.preprocess) {
char error[512];
- if (rna_validate_identifier(identifier, error, 0) == 0) {
+ if (rna_validate_identifier(identifier, error, FALSE) == 0) {
fprintf(stderr, "%s: struct identifier \"%s\" error - %s\n", __func__, identifier, error);
DefRNA.error = 1;
}
@@ -909,7 +911,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
if (DefRNA.preprocess) {
char error[512];
- if (rna_validate_identifier(identifier, error, 1) == 0) {
+ if (rna_validate_identifier(identifier, error, TRUE) == 0) {
fprintf(stderr, "%s: property identifier \"%s.%s\" - %s\n", __func__,
CONTAINER_RNA_ID(cont), identifier, error);
DefRNA.error = 1;
@@ -926,6 +928,16 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
dprop = MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
rna_addtail(&dcont->properties, dprop);
}
+ else {
+#ifdef DEBUG
+ char error[512];
+ if (rna_validate_identifier(identifier, error, TRUE) == 0) {
+ fprintf(stderr, "%s: runtime property identifier \"%s.%s\" - %s\n", __func__,
+ CONTAINER_RNA_ID(cont), identifier, error);
+ DefRNA.error = 1;
+ }
+#endif
+ }
prop = MEM_callocN(rna_property_type_sizeof(type), "PropertyRNA");
@@ -2674,7 +2686,7 @@ static FunctionRNA *rna_def_function(StructRNA *srna, const char *identifier)
if (DefRNA.preprocess) {
char error[512];
- if (rna_validate_identifier(identifier, error, 0) == 0) {
+ if (rna_validate_identifier(identifier, error, FALSE) == 0) {
fprintf(stderr, "%s: function identifier \"%s\" - %s\n", __func__, identifier, error);
DefRNA.error = 1;
}