@bitloops/bl-transpiler
Version:
The one and only Bitloops Language transpiler
63 lines • 2.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/**
* Bitloops Language CLI
* Copyright (C) 2022 Bitloops S.A.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For further information you can contact legal(at)bitloops.com.
*/
const Transpiler_js_1 = tslib_1.__importDefault(require("../../../src/Transpiler.js"));
const index_js_1 = require("./mocks/access-violation/index.js");
const index_js_2 = require("../../../src/parser/index.js");
const index_js_3 = require("../../../src/ast/core/index.js");
const index_js_4 = require("../../../src/target/index.js");
const supportedLanguages_js_1 = require("../../../src/target/supportedLanguages.js");
describe('Semantic method scopes End To End', () => {
const boundedContext = 'Hello world';
const module = 'demo';
const options = {
formatterConfig: null,
targetLanguage: supportedLanguages_js_1.SupportedLanguages.TypeScriptNest,
};
index_js_1.SEMANTIC_ERRORS_METHOD_SCOPES_END_TO_END_TEST_CASES.forEach((testCase) => {
const parser = new index_js_2.BitloopsParser();
const originalLanguageASTToIntermediateModelTransformer = new index_js_3.IntermediateASTParser();
const intermediateASTModelToTargetLanguageGenerator = new index_js_4.TargetGenerator();
const transpiler = new Transpiler_js_1.default(parser, originalLanguageASTToIntermediateModelTransformer, intermediateASTModelToTargetLanguageGenerator);
it(`${testCase.description}`, async () => {
// given
const input = {
core: [
{
boundedContext,
module,
fileId: 'fileIdCore',
fileContents: testCase.input,
},
],
setup: [],
};
// when
const result = transpiler.transpile(input, options);
if (Transpiler_js_1.default.isTranspileError(result)) {
console.log(result);
}
expect(Transpiler_js_1.default.isTranspileError(result)).toBeFalsy();
});
});
});
//# sourceMappingURL=method-scopes.steps.js.map