Fixed #101 : Implement PLURIAL

Fixed #103 : Implement PlurialNodeParser
Fixed #104 : Implement dynamic concept
Fixed #107 : PrepareEvalxxxEvaluator: context hints are lost on a second evaluation
This commit is contained in:
2021-08-05 19:07:21 +02:00
parent c798c2c570
commit 71d1b1d1ca
31 changed files with 600 additions and 105 deletions
+3 -3
View File
@@ -971,13 +971,13 @@ class CreateObjectIdentifiers:
self.identifiers_key = {}
@staticmethod
def sanitize(identifier):
def sanitize(identifier, default="0"):
if identifier is None:
return ""
res = ""
for c in identifier:
res += c if c.isalnum() else "0"
res += c if c.isalnum() else default
return res
def get_identifier(self, obj, wrapper):
@@ -998,7 +998,7 @@ class CreateObjectIdentifiers:
identifier = wrapper + self.sanitize(obj.key or obj.name)
if obj.id:
identifier += "__" + obj.id
identifier += "__" + self.sanitize(obj.id, "_")
if identifier in self.identifiers_key:
self.identifiers_key[identifier] += 1