Skip to content
Snippets Groups Projects
Commit ece5ab1e authored by lucien.noel's avatar lucien.noel
Browse files

correction pour l'affectation des constantes

parent 4ce42e89
No related branches found
No related tags found
No related merge requests found
......@@ -36,10 +36,10 @@ public class SemanticAnalyzer implements ASTVisitor {
if(!(node.getDestination() instanceof Idf)){
throw new RuntimeException("Impossible d'effectuer une affectation sur quelque chose d'autre qu'un identifiant !");
}
String idfNom = ((Idf)node.getDestination()).getNom();
if(TDS.getInstance().identifier(new Entree(((Idf) node.getDestination()).getNom())).cst){
throw new RuntimeException("Impossible d'effectuer une affectation sur une constante !");
throw new RuntimeException("Impossible d'effectuer une affectation sur la constante '"+idfNom+"' !");
}
String idfNom = ((Idf)node.getDestination()).getNom();
if(isExpressionBooleen(node.getDestination()) && !isExpressionBooleen(node.getSource())){
throw new RuntimeException("Impossible d'affecter un non-booleen à la variable '"+idfNom+"' !");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment