SNSystems / dexter

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

Add multi-line command parsing #32

Closed OCHyams closed 5 years ago

OCHyams commented 5 years ago

Commands can be split over multiple lines provided that there is no extraneous text (e.g. C++ code) between the command's parentheses.

OCHyams commented 5 years ago

I didn't see Tom's comment, I'll refactor it a bit now.

OCHyams commented 5 years ago

Refactored.

TomWeaver18 commented 5 years ago

LGTM, thanks for taking my feedback comments onboard.

OCHyams commented 5 years ago

Rebased and squashed.

I don't do any checking for // style comment blocks because I think it would be very easy to generate false positives. The // could be embedded in a string, and then checking for the end of the string requires checking for the different formats of string literals as well as avoiding escaped quotes.

Reporting an error seems just as hard to me. But not impossible, I could give it a go?

jmorse commented 5 years ago

True, I was imagining people who used comments only on lines where there was no C/C++, I guess they could do more complicated things.

It's probably best to just document multi-line commands as only working in C-style comments /**/ in that case.