Low-Severity Bug with Breakpoint Parsing

Hi Mark/Shane,

I’ve recently been having some issues with breakpoint markers not appearing in debug mode. It was intermittent in nature as I was debugging & quite frustrating.

I’ve discovered the cause:

Note the lack of breakpoints offered for the last 2 lines.

set a to 1
set b to 2

(*set x to 7
set y to 8 #FIXME*)

set c to 3
set d to 4

As it turns out, having a line containing a # comment initiator followed by a multi-line comment terminator *) will cause Script Debugger to stop looking for possible breakpoints in the rest of the script, even though this is valid AppleScript code & does not pose any compile/runtime issues.

(Note that the same is not true for the -- comment initiator, which will “comment out” the multi-line comment terminator *)).

Could the debugger’s parsing logic be updated in a future release? This is trivial to work around now that I’m aware of the issue, but I certainly use a mix of # and (* *) quite often while troubleshooting scripts, so it’s liable to pop up accidentally again.

1 Like

Probably the easiest way to ensure you don’t get caught out is to always put the multi-line terminator on its own line.

(*set x to 7
set y to 8 #FIXME
*)
1 Like