From ec617dfc15a12ed6549cf9cc0f0d85825f9b8420 Mon Sep 17 00:00:00 2001 From: Mike Lischke Date: Mon, 30 Dec 2024 14:52:07 +0100 Subject: [PATCH] Use the tool version we forked from as current runtime version This is the version against which the target runtimes test for their compatibility, except the JS and TS runtimes. This will last until we have start implementing the new target runtime environment, which will need adjustments anyway. --- src/codegen/model/OutputFile.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/codegen/model/OutputFile.ts b/src/codegen/model/OutputFile.ts index df2e424..7c307fa 100644 --- a/src/codegen/model/OutputFile.ts +++ b/src/codegen/model/OutputFile.ts @@ -4,7 +4,7 @@ * can be found in the LICENSE.txt file in the project root. */ -import { antlrVersion } from "../../tool-parameters.js"; +import { RuntimeMetaData } from "antlr4ng"; import { Grammar } from "../../tool/Grammar.js"; import { ActionAST } from "../../tool/ast/ActionAST.js"; import { OutputModelFactory } from "../OutputModelFactory.js"; @@ -12,11 +12,21 @@ import { Action } from "./Action.js"; import { OutputModelObject } from "./OutputModelObject.js"; export abstract class OutputFile extends OutputModelObject { + private readonly checkVersion = () => { + RuntimeMetaData.checkVersion("4.13.2", RuntimeMetaData.VERSION); + }; + public readonly fileName: string; public readonly grammarFileName: string; public readonly TokenLabelType?: string; public readonly inputSymbolType?: string; - public readonly ANTLRVersion = antlrVersion; + + /** + * This is the version the runtimes test against for their compatibility. + * We use the version of the old ANTLR4 tool here, until we start implementing the new target + * infrastructure. + */ + public readonly ANTLRVersion = "4.13.2"; // antlrVersion; public constructor(factory: OutputModelFactory, fileName: string) { super(factory);