[formatter] support negative indicies

for example '{items[-3]}'
This commit is contained in:
Mike Fährmann
2025-09-11 20:50:50 +02:00
parent 0dfc3b18d3
commit 9035b92230
2 changed files with 7 additions and 0 deletions

View File

@@ -301,6 +301,8 @@ def parse_field_name(field_name):
key = _slice(key[1:])
else:
key = _slice(key)
elif key[0] == "-":
key = int(key)
else:
key = key.strip("\"'")
except TypeError: