diff --git a/src/server/beebasm-ts/lineparser.ts b/src/server/beebasm-ts/lineparser.ts index 0d556f5..81d00ba 100644 --- a/src/server/beebasm-ts/lineparser.ts +++ b/src/server/beebasm-ts/lineparser.ts @@ -3601,10 +3601,13 @@ export class LineParser { typeof value !== 'number' || value !== ObjectCode.Instance.GetPC() ) { - throw new AsmException.SyntaxError_SecondPassProblem( - this._line, - oldColumn, - ) + if (!ObjectCode.Instance.HadSecondPassError) { + ObjectCode.Instance.HadSecondPassError = true + throw new AsmException.SyntaxError_SecondPassProblem( + this._line, + oldColumn, + ) + } } SymbolTable.Instance.AddLabel(symbolName) } diff --git a/src/server/beebasm-ts/objectcode.ts b/src/server/beebasm-ts/objectcode.ts index ed7571c..c7b2e20 100644 --- a/src/server/beebasm-ts/objectcode.ts +++ b/src/server/beebasm-ts/objectcode.ts @@ -46,6 +46,7 @@ export class ObjectCode { // After one consistency error, all subsequent code will probably be wrong, so just raise once // or we'll get a lot of errors and potentially cause severe slowdown private _hadConsistencyError = false + private _hadSecondPassError = false private constructor() { //SymbolTable.Instance.AddSymbol( "CPU", this._CPU ); @@ -62,6 +63,7 @@ export class ObjectCode { this._aFlags.fill(0) this._aMapChar.fill(0) this._hadConsistencyError = false + this._hadSecondPassError = false } public GetCPU(): number { @@ -81,6 +83,14 @@ export class ObjectCode { this._PC = i } + public get HadSecondPassError(): boolean { + return this._hadSecondPassError + } + + public set HadSecondPassError(s: boolean) { + this._hadSecondPassError = s + } + public PutByte(b: number): void { if (this._PC > 0xffff) { throw new AsmException.AssembleError_OutOfMemory()