SNSystems / dexter

DExTer - Debug Experience Tester
MIT License
33 stars 6 forks source link

Provide warning if command is not immediately proceeded by '(' #44

Closed OCHyams closed 5 years ago

OCHyams commented 5 years ago

Without this patch, parsing 'command_name (' will cause an exception.

This change means the offending command will be ignored and a helpful warning will be given.

Doing this instead of just ignoring the whitespace lets us refer to commands in a test file without the command being parsed.

Note: Warnings can be suppresed with -w.

NOTE: Without a larger change/refactor I'm not sure how to make this less ugly.

OCHyams commented 5 years ago

Thinking about it, maybe it would make more sense to escape commands with '\' and consume the whitespace instead of ignoring the command in the scenario outlined in the PR?

TomWeaver18 commented 5 years ago

whitespace should be optional would be my preference, if I write '.command. .loads of white space. .open_paran.' that should be the same as '.command. .open_paran.'

OCHyams commented 5 years ago

I agree and think that this PR should be closed.

However, I still think we should be able to escape commands (e.g. \DexLabel('something') is ignored).