Skip to content

Commit

Permalink
21396: Updates the debugger code for changes in Amalgam debugger outp…
Browse files Browse the repository at this point in the history
…ut (#18)

Updates to debug properly with Amalgam > 54.3.7
  • Loading branch information
cademack authored Aug 27, 2024
1 parent 38b5916 commit eb0cbab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amalgam-lang",
"version": "2.1.0",
"version": "2.1.1",
"type": "commonjs",
"publisher": "howso",
"displayName": "Amalgam Language",
Expand Down
7 changes: 4 additions & 3 deletions src/debugger/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export enum RuntimeEvent {
export enum RuntimeStackType {
CALL = "Call", // The amalgam "call" stack
CONSTRUCTION = "Construction", // The construction stack
INTERPRET_NODE = "Interpret node", // Standard debugger call stack
INTERPRET_NODE = "Interpret node", // Standard debugger call stack Amalgam<54.3.8
OPCODE = "Opcode" // Standard debugger call stack Amalgam>=54.3.8
}

/** The types of breakpoints */
Expand Down Expand Up @@ -186,7 +187,7 @@ export class AmalgamRuntime extends EventEmitter {
breakpointLine: /^ {2}(?<line>\d+)(?: (?<file>.+))?$/gm,
// Breakpoints and stack are matched via the header line and existing subsequent nested lines
breakpoints: /^(?<type>Line) Breakpoints:\n(?<brs>^(?:\s{2}.+)+)$/gm,
stack: /^(?<type>Interpret node) stack:\n(?<frames>^(?:\s{2}.+)+)$/gm,
stack: /^(?<type>Interpret node|Opcode) stack:\n(?<frames>^(?:\s{2}.+)+)$/gm,
// Expression results match all lines up to final empty line
expression: /^(?<value>[\s\S]+)\n{2}$/gm,
// Results match all lines starting with 2 spaces
Expand Down Expand Up @@ -823,7 +824,7 @@ export class AmalgamRuntime extends EventEmitter {
while ((matches = reg.exec(lines)) != null) {
if (matches.groups) {
const type = matches.groups.type;
if (type !== RuntimeStackType.INTERPRET_NODE) {
if (type !== RuntimeStackType.INTERPRET_NODE && type !== RuntimeStackType.OPCODE) {
continue;
}
let frameReg: RegExp;
Expand Down

0 comments on commit eb0cbab

Please sign in to comment.