From 6b244b8c6c4a1f962ad88c632081a0f883597c5d Mon Sep 17 00:00:00 2001 From: di68kap Date: Tue, 19 Feb 2019 17:44:19 +0100 Subject: [PATCH] - hotfix: DHParser/syntaxtree.py Node.content property --- DHParser/syntaxtree.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/DHParser/syntaxtree.py b/DHParser/syntaxtree.py index 97948c61..6be2da0c 100644 --- a/DHParser/syntaxtree.py +++ b/DHParser/syntaxtree.py @@ -362,14 +362,15 @@ class Node: # (collections.abc.Sized): Base class omitted for cython-compatibil string content of the child-nodes is recursively read and then concatenated. """ - if self._content is None: - if self.children: - self._content = "".join(child.content for child in self.children) - else: - # self._content = self._result - self._content = str(self._result) - self._result = self._content # self._result might be more efficient as a string!? - return self._content + return "".join(child.content for child in self.children) if self.children else str(self._result) + # if self._content is None: + # if self.children: + # self._content = "".join(child.content for child in self.children) + # else: + # # self._content = self._result + # self._content = str(self._result) + # self._result = self._content # self._result might be more efficient as a string!? + # return self._content # # # @content.setter -- GitLab