What steps will reproduce the problem? 1. Create a function containing an if...else... contruct 2. place a breakpoint at the else statement (M-c b) 3. evaluate the function (C-c C-f)
What is the expected output? What do you see instead? Should evaluate function, but get errors due to browser command interrupting the if...else... construct
Please provide any additional information below. Would be nice if it could check for this and move the breakpoint to just after the "else".
Comment #1
Posted on Dec 10, 2010 by Quick WombatDo you place the break point between the closing } of if and else statement? Then of course this is illegal in R. If you place a breakpoint in the simple if..else statement (not braces {}) than it is also inappropriate because simple if.. else does not allow multiple statements.
Indeed, I can try to figure out the proper context of "{" and try to place the breakpoint after the "{", but that would mean checking for other language forms like while, repeat, function, for. Additionally there are many other places where the browser() would be illegal, and to check for all those would mean writing my own parser of R :). I will give it some thoughts, but for time being it is easier to clarify the documentation for how the breakpoints are implemented and what is legal and what is not. Thanks for the feedback.
Comment #2
Posted on Dec 10, 2010 by Quick WombatAdded a couple of words on how the breakpoints work on the main page, thanks.
Comment #3
Posted on Jul 30, 2011 by Quick WombatAs mentioned previously, this would require to virtually implement the R parser, and is defenitely not a priority now. May be some day when ess-tracebug is feature complete I will get down and implement the basic rules.
Status: WontFix
Labels:
Type-Enhancement
Priority-Low
Usability