Skip to content

Question: Should we allow names/identifiers that start with a number

Currently we do not allow those names, the first char of a name/identifier needs to be a letter.

The current behavior follows the specification:

[A-Za-z*][-A-Za-z0-9_]
https://hyperrealm.github.io/libconfig/libconfig_manual.html#Configuration-File-Grammar

We could deviate from the spec and remove this requirement in https://gitlab.com/LawnCable/libconfig-parser-js/-/blob/master/src/parts/Identifier.js?ref_type=heads#L4, but we then need to mention it in the readme as a quirk: https://gitlab.com/LawnCable/libconfig-parser-js#quirks

The reason for changing the behavior is, that we have weapon ids that start with numbers in our game database:

	// Strong Resistance to Lightsaber, vulnerable to bows & rifles
	WeaponAttacks: {
		Katars: 1400
		1HSwords: 9000
		Bows: 12000
		Rifles: 15000
	}

But we could also say that we should instead change the game data to follow the specification.