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

Missing support for #include and #base directives

Open hkva opened this issue 2 years ago • 6 comments

Hi.

Valve's KeyValues format supports two statements for including and merging other KeyValues files ( #include and #base), but trying to parse a vdf file using either statement causes a ParseError. Merging other files seems to be beyond the scope of this parser, but would it be possible to add an option that ignores statements like these instead of throwing an error?

Here's a stripped-down example from Team Fortress 2's population files:

minimal.pop:

#base robot_standard.pop

WaveSchedule
{

	StartingCurrency		1200
	RespawnWaveTime 		2
	CanBotsAttackWhileInSpawnRoom no
}

robot_standard.pop:

WaveSchedule
{
	Templates
	{
		// Sniper
		T_TFBot_Sniper
		{
			Class Sniper
			Skill Hard
			MaxVisionRange 2500
		}
	}
}

hkva avatar Nov 03 '21 23:11 hkva