Skip to content

Commit 4b9c080

Browse files
committed
Update README.md
1 parent 998d012 commit 4b9c080

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,37 @@ Of course the class KeyValues also provides the standard `dict` interface method
6868

6969
# What is missing
7070

71-
Generally the checking of VDF file syntax, i.e. if brackets are closed and so on. The only check is if after `"key"` is a starting bracket `{`.
71+
Generally the checking of VDF file syntax, i.e. if brackets are closed and so on. The only check is if after `"key"` is a starting bracket `{`. So it's expected that input VDF file will have a 'clean' structure:
72+
73+
* one key or key-value per line, if value isn't subpart:
74+
```
75+
"key" "value"
76+
```
77+
* values can be on two lines (I have to implement this because Valve do it sometimes in their VDF files):
78+
```
79+
"key" "val
80+
ue"
81+
```
82+
* when value is a subpart, starting bracket `{` is expected to be on separate line after the corresponding key:
83+
```
84+
"key"
85+
{
86+
"key2" "value"
87+
}
88+
```
89+
* everything that doesn't match key or key-value regex or if line doesn't start with `{` or `}` is ignored. So this is ok:
90+
```
91+
"key"
92+
// some comment
93+
{
94+
"key2" "value"
95+
}
96+
```
97+
* even this should be ok, but don't do it, because Valve itself won't probably parse it :)
98+
```
99+
"key"
100+
some comment
101+
{ comment
102+
"key2" "value" comment
103+
} comment
104+
```

0 commit comments

Comments
 (0)