From 006cbd3690e0d968722f0a468c980073270e0841 Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Mon, 11 Nov 2024 20:23:03 -0300 Subject: [PATCH] WIP: add some console logs --- package.json | 2 +- src/linker.ts | 4 ++++ test/interpreter.test.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 178fbeee..aae51826 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test:game": "mocha --parallel -r ts-node/register/transpile-only test/**/game.test.ts", "test:dynamicDiagram": "mocha --parallel -r ts-node/register/transpile-only test/dynamicDiagram.test.ts", "test:helpers": "mocha --parallel -r ts-node/register/transpile-only test/helpers.test.ts", - "test:interpreter": "mocha --parallel -r ts-node/register/transpile-only test/interpreter.test.ts", + "test:interpreter": "mocha -r ts-node/register/transpile-only test/interpreter.test.ts", "test:linker": "mocha --parallel -r ts-node/register/transpile-only test/linker.test.ts", "test:messageReporter": "mocha --parallel -r ts-node/register/transpile-only test/messageReporter.test.ts", "test:model": "mocha --parallel -r ts-node/register/transpile-only test/model.test.ts", diff --git a/src/linker.ts b/src/linker.ts index 75dfe767..56329f02 100644 --- a/src/linker.ts +++ b/src/linker.ts @@ -93,6 +93,10 @@ export const assignScopes = (root: Node): void => { : parent?.scope assign(node, { scope: new LocalScope(containerScope) }) + if (node.name === 'Medico') { + console.info(canBeReferenced(node), node.name, node.scope) + } + parent?.scope?.register(...scopeContribution(node)) }) diff --git a/test/interpreter.test.ts b/test/interpreter.test.ts index 63529de5..35c9e5a6 100644 --- a/test/interpreter.test.ts +++ b/test/interpreter.test.ts @@ -271,7 +271,7 @@ describe('Wollok Interpreter', () => { checkSuccessfulResult('{1 + 2}', '{1 + 2}') }) - it('should be able to execute sentences related to a hierarchy defined in different packages', () => { + it.only('should be able to execute sentences related to a hierarchy defined in different packages', () => { const replEnvironment = buildEnvironment([{ name: 'jefeDeDepartamento.wlk', content: ` import medico.* @@ -328,7 +328,7 @@ describe('Wollok Interpreter', () => { }]) interpreter = new Interpreter(Evaluation.build(replEnvironment, WRENatives)) const { error } = interprete(interpreter, 'testit.test()') - console.info(error) + // console.info(error) expect(error).to.be.undefined })