ZScript-VSCode icon indicating copy to clipboard operation
ZScript-VSCode copied to clipboard

Anonymous functions break highlighting in the `States` block

Open nashmuhandes opened this issue 9 months ago • 0 comments

Image

Image

With versus without anonymous functions. Instructions like Loop, Goto, Stop etc lose their purple (?) coloring.

The following for your copy/pasting convenience:

	States
	{
	Spawn:
		MODL A 1 Bright;
		Loop;
	Select:
		TNT1 A 1
		{
			let wpn = invoker;
			let pmo = wpn.GetPlayerPawn();
			if (pmo)
			{
				wpn.MarkWeaponModelForUpdate();
				if (cl_viewtilt)
					DimensionsChoreograph.ExecuteDirect(pmo, "PlayerWeaponSelect");
			}

			A_Raise(int.max);
		}
		Goto Ready;
	Deselect:
		TNT1 A 1 A_Lower(int.max);
		Loop;
	LightDone:
		0000 A 0 A_Light0();
		Stop;
	}
	States
	{
	Spawn:
		MODL A -1;
		Stop;
	Select:
		0000 A 1 A_Raise(int.max);
		Loop;
	Deselect:
		0000 A 1 A_Lower(int.max);
		Loop;
	LightDone:
		0000 A 0 A_Light0();
		Stop;
	}

nashmuhandes avatar May 20 '25 01:05 nashmuhandes