Double punctuation error associated with definition

Hi all, I’ve picked up some excellent knowledge about taking parts from objects using definition which worked well until I referred to it in The Road North. At that point I got a double punctuation error I can’t untangle.

The brightly coloured flag is part of the delivery bike.

Definition: a thing is attached rather than loose if it is part of something.

Instead of taking the attached brightly coloured flag:
now the player carries the brightly coloured flag;
say “You remove the brightly coloured flag from the delivery bike. Danger! Danger! Remember: Safety First!”;

Instead of putting the loose brightly coloured flag on the delivery bike:
now the brightly coloured flag is part of the delivery bike;
say “Phew. You put the brightly coloured flag back on the bike and all is right with the world.”;

Instead of putting the attached brightly coloured flag on the delivery bike: 
say "The brightly coloured flag is already in place and keeping you safe."

The description of the brightly coloured flag is "These things were called [italic type]chopper guards[roman type] when you were a kid. They were cool then and your eight-year-old self would have been happy to know you'd still use one in adulthood.  Your adult self is not so thrilled to be riding around with one on their bike."



[THE ROAD NORTH]
The Road North is a room. The Road North is north of The Wrought Iron Gate.
If the brightly coloured flag is not attached to the delivery bike, say "you're dead."
If the brightly coloured flag is attached to the delivery bike, say "The road stretches North as far as you can see. The gentle but insistent fall of snow is blanketing everything in sight and muffling all sound. You'd better deliver the package before the road becomes impassible."

It’s a strange error message, but the compiler is confused by the loose if statements, which are not allowed. They must be inside rules or in text substitutions. Also, the attached/loose definition doesn’t extend into checking where the item is attached to so you’ll need the usual “is part of.”

[THE ROAD NORTH]
The Road North is a room. The Road North is north of The Wrought Iron Gate.
"[if the brightly coloured flag is not part of the delivery bike]you're dead.[otherwise]The road
stretches North as far as you can see. The gentle but insistent fall of snow is blanketing
everything in sight and muffling all sound. You'd better deliver the package before the
road becomes impassible."

(Possibly printing the “you’re dead” inside the room description is not what you intended, but this should be a good starting point.)

Thank you for taking the time to reply. I appreciate it.

It works, I’ll just have to spend some time trying to get my head a round it to see where I’ve erred.

@Juhana also, the you’re dead is a truncated dialog slug I’ll complete. The intent is that that’s the end of the game. Can I end a game in the middle of a sentence?

Theoretically you can end the game in the room description, but it’s not the right place for that. Descriptions shouldn’t do anything other than print text. What you’d do is write a rule with conditions that decide when the game should end. For example:

Instead of going to the Road North when the brightly coloured flag is not part of the delivery bike:
	say "You're dead.";
	end the story.