-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#503 Matriz sendo construida de forma errada #574
Conversation
@leonelsanchesdasilva Se concordar com a forma que resolvi no VisuAlg, vamos precisar implementar nos demais dialetos, não fiz no interpretador-base e no avaliador-sintático para não quebrar os demais dialetos, adicionei a implementação somente para VisuAlg nesse primeiro momento. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gostei do que foi feito aqui, mas acho que algumas mudanças são necessárias.
@@ -210,6 +210,9 @@ export class InterpretadorBase implements InterpretadorInterface { | |||
/* if (expressao === null || expressao === undefined) { | |||
console.log('Aqui'); | |||
} */ | |||
if (!expressao) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Na verdade é pra dar erro nesse ponto mesmo. Se você quiser mudar para dar um throw aqui, por exemplo, "expressão não deveria ser nula aqui". Agora, isso aqui não pode ficar assim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coloquei devido a um Promisse.all(...)
que tinha indice2
pra ser resolvido e que pode ou não ser nulo.
); | ||
} | ||
return objeto.charAt(valorIndice1); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acho que esse else
não precisa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resquícios do interpretador-base.
objeto instanceof DeleguaModulo | ||
) { | ||
objeto[indicePrimario] = valor; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acho que não precisa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resquícios do interpretador-base.
@@ -33,6 +37,158 @@ export class InterpretadorVisuAlg extends InterpretadorBase { | |||
throw new Error('Método não implementado.'); | |||
} | |||
|
|||
async visitarExpressaoAtribuicaoPorIndice(expressao: any): Promise<any> { | |||
const { indice1, indice2 } = expressao.indice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acho que estamos extrapolando o construto aqui. Sou a favor de criarmos outro: AcessoElementoMatriz
.
Continuada na PR #575 |
Resolve: #503