From 40b38fc70ec485c09eddf49225fab09fc816c7a5 Mon Sep 17 00:00:00 2001 From: golnazraja <43951923+golnazraja@users.noreply.github.com> Date: Fri, 3 May 2024 14:11:21 +0300 Subject: [PATCH] add support for scientific notation parsing while running OpenSCENARIO files (#1023) Co-authored-by: glopezdiest <58212725+glopezdiest@users.noreply.github.com> --- srunner/tools/openscenario_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srunner/tools/openscenario_parser.py b/srunner/tools/openscenario_parser.py index a7c8e05ea..a32b5d6ea 100644 --- a/srunner/tools/openscenario_parser.py +++ b/srunner/tools/openscenario_parser.py @@ -105,7 +105,7 @@ def is_literal(self) -> bool: """ Returns: True when text is a literal/number """ - return self._is_matching(pattern=r"(-)?\d+(\.\d*)?(e[+-]\d*)?") + return self._is_matching(pattern=r"(-)?\d+(\.\d*)?") or self._is_matching(pattern=r"[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?") def is_parameter(self) -> bool: """