mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Merge pull request #3694 from count-infinity/3692-parser-errors
Fixing funcparser issues
This commit is contained in:
commit
6567f26615
2 changed files with 5 additions and 1 deletions
|
|
@ -339,6 +339,7 @@ class FuncParser:
|
|||
# always store escaped characters verbatim
|
||||
if curr_func:
|
||||
infuncstr += char
|
||||
curr_func.rawstr += char
|
||||
else:
|
||||
fullstr += char
|
||||
escaped = False
|
||||
|
|
@ -372,7 +373,8 @@ class FuncParser:
|
|||
curr_func.open_lsquare = open_lsquare
|
||||
curr_func.open_lcurly = open_lcurly
|
||||
# we must strip the remaining funcstr so it's not counted twice
|
||||
curr_func.rawstr = curr_func.rawstr[: -len(infuncstr)]
|
||||
if len(infuncstr) > 0:
|
||||
curr_func.rawstr = curr_func.rawstr[: -len(infuncstr)]
|
||||
current_kwarg = ""
|
||||
infuncstr = ""
|
||||
double_quoted = -1
|
||||
|
|
|
|||
|
|
@ -231,6 +231,8 @@ class TestFuncParser(TestCase):
|
|||
("Test literal3 $typ($lit(1)aaa)", "Test literal3 <class 'str'>"),
|
||||
("Test literal4 $typ(aaa$lit(1))", "Test literal4 <class 'str'>"),
|
||||
("Test spider's thread", "Test spider's thread"),
|
||||
("Test invalid syntax $a=$b", "Test invalid syntax $a=$b"),
|
||||
(r"Test invalid syntax $a\= b", "Test invalid syntax $a= b"),
|
||||
]
|
||||
)
|
||||
def test_parse(self, string, expected):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue