martin-pabst / Online-IDE-new-compiler

Online-IDE with new compiler
GNU General Public License v3.0
0 stars 0 forks source link

move-instruction-pointer #16

Closed fjf2002 closed 4 days ago

fjf2002 commented 1 week ago

One step towards #15:

Move the instuction pointer. Proof of concept.

Type the following program:

int i = 42;
i++;
println(i);

Put a breakpoint in line 3. Execute. When the program halts, Right-click on line 2 and select "Interpreter Goto". Continue executing the program. It will spit out 44 instead of 43.

@martin-pabst What do you think?

fjf2002 commented 4 days ago

@martin-pabst: Thanks for merging, but: At this stage this was supposed to be a proof-of-concept.

addAction should be moved to JavaAddEditorShortcuts, where access to this.main will get neccessary...

martin-pabst commented 4 days ago

This IS cool. I merged it to main and added a few checks to prevent going to a line outside the current method's scope. I introduced editor contexts to have the menu item shown only if SchedulerState == running or SchedulerState == paused.

Thank you!

martin-pabst commented 4 days ago

addAction should be moved to JavaAddEditorShortcuts, where access to this.main will get neccessary... Done.