[Libreoffice-commits] core.git: librelogo/source sw/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Mar 13 06:41:03 UTC 2019
librelogo/source/LibreLogo/LibreLogo.py | 2 +-
sw/qa/uitest/librelogo/compile.py | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 8547a8d90af69104f4eb27137d39678b45d6d9d1
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Tue Mar 12 23:11:39 2019 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Wed Mar 13 07:40:36 2019 +0100
tdf#124035 LibreLogo: support starting colon in variable names
Regression from the commit 740b99783b5480fcd1e5fce7c1beb5967d015041
"tdf#120413 LibreLogo: handle complex Logo expressions".
Change-Id: Iaae54efacf86a03a6611c154a40068ed058d43e7
Reviewed-on: https://gerrit.libreoffice.org/69138
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index 6dde2f3c237a..d4fa0cfea340 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -1903,7 +1903,7 @@ def __compil__(s):
# compile to Python
subroutines = re.compile(r"(?iu)(?<!def )(?<![_\w])\b(%s)\b(?![\w(])" % "|".join(subnames + functions + defaultfunc))
operators = re.compile(r"(?iu)(%s)" % "(?:[ ]*([+*/<>]|//|==|<=|>=|<>|!=)[ ]*|[ ]*-[ ]+|(?<! )-[ ]*|[ ]*[*][*][ ]*)") # operators, eg. " - ", "-", "- "
- atoms = re.compile(r"(?iu)(%s)" % "[0-9]+([.,][0-9]+)?|\w+([.]\w)?")
+ atoms = re.compile(r"(?iu)(%s)" % "[0-9]+([.,][0-9]+)?|:?\w+([.]\w)?")
# store argument numbers of all subroutines in dictionary "names"
names = {key: 1 for key in functions + defaultfunc}
diff --git a/sw/qa/uitest/librelogo/compile.py b/sw/qa/uitest/librelogo/compile.py
index 79a297ef1593..28905a36b897 100644
--- a/sw/qa/uitest/librelogo/compile.py
+++ b/sw/qa/uitest/librelogo/compile.py
@@ -81,6 +81,7 @@ class LibreLogoCompileTest(UITestCase):
# PROCEDURE WITH ARGUMENTS
("TO x y\nLABEL y\nEND\nx 25", "global x\ndef x(y):\n __checkhalt__()\n %s\n label(y)\n %s\n%s\nx(25)" % (((self.LS),)*3)),
("TO x :y :z\nLABEL :y + :z\nEND\nx 25 26", "global x\ndef x(_y, _z):\n __checkhalt__()\n %s\n label(_y + _z)\n %s\n%s\nx(25, 26)" % (((self.LS),)*3)),
+ ("TO x :y :z\nLABEL :y + :z\nEND\nx 25 :w", "global x\ndef x(_y, _z):\n __checkhalt__()\n %s\n label(_y + _z)\n %s\n%s\nx(25, _w)" % (((self.LS),)*3)),
# UNICODE VARIABLE NAMES
("Erdős=1", "Erd__u__0151s=1"),
# STRING CONSTANTS
More information about the Libreoffice-commits
mailing list