mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Improve Minetest config parsing error messages
This commit is contained in:
parent
0054f362a7
commit
e4d0b57f3c
@ -16,16 +16,13 @@ def parse_conf(string):
|
||||
|
||||
key_value = line.split("=", 2)
|
||||
if len(key_value) < 2:
|
||||
syntax_error("No value given")
|
||||
syntax_error("Expected line to contain '='")
|
||||
|
||||
key = key_value[0].strip()
|
||||
if key == "":
|
||||
syntax_error("Empty key")
|
||||
syntax_error("Missing key before '='")
|
||||
|
||||
value = key_value[1].strip()
|
||||
if value == "":
|
||||
syntax_error("Empty value")
|
||||
|
||||
if value.startswith('"""'):
|
||||
value_lines = []
|
||||
closed = False
|
||||
|
Loading…
Reference in New Issue
Block a user