vdf-parser icon indicating copy to clipboard operation
vdf-parser copied to clipboard

[$!ENGLISH] conditional causing error

Open BeepIsla opened this issue 2 years ago • 2 comments

Hey,

I am having issues parsing the English translation file for TF2. Specifically the problem seems to be that the parser only takes !$/$ for valid conditionals while apparently $! is also valid according to TF2.

Error:

VDF.parse: invalid syntax on line 10850:
[$!ENGLISH]

Way to reproduce the error:

const VDF = require("vdf-parser");
const got = require("got");

got("https://raw.githubusercontent.com/SteamDatabase/GameTracking-TF2/master/tf/resource/tf_english.txt", {
	resolveBodyOnly: true,
}).then(async (body) => {
	let json = VDF.parse(body);
	console.log(`Got ${Object.keys(json.lang.Tokens).length} translation tokens`);
}).catch((err) => {
	console.error(err);
});

BeepIsla avatar Sep 11 '21 05:09 BeepIsla