We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9120ef2 + 0fde125 commit 862a9a5Copy full SHA for 862a9a5
dolang/language.py
@@ -85,6 +85,9 @@ def eval_data(data: "yaml_structure", calibration={}):
85
import warnings
86
from yaml import MappingNode, SequenceNode, ScalarNode
87
88
+ d = calibration.copy()
89
+ d.update(functions)
90
+
91
if isinstance(data, ScalarNode):
92
93
val = data.value
@@ -94,7 +97,7 @@ def eval_data(data: "yaml_structure", calibration={}):
94
97
elif isinstance(val, str):
95
98
# could be a string, could be an expression, could depend on other sections
96
99
try:
- val = eval(val.replace("^", "**"), calibration)
100
+ val = eval(val.replace("^", "**"), d)
101
except Exception as e:
102
warnings.warn(f"Impossible to evaluate expression: {val}")
103
return val
0 commit comments