diff --git a/src/analyseur_syntaxyque.c b/src/analyseur_syntaxyque.c index 2e40e48..20fc1a9 100644 --- a/src/analyseur_syntaxyque.c +++ b/src/analyseur_syntaxyque.c @@ -47,7 +47,7 @@ void programme() { if( est_premier( _optDecVariables_, uniteCourante ) || est_premier( _listeDecFonctions_, uniteCourante )) { optDecVariables(); listeDecFonctions(); - } else { + } else if ( !est_suivant( _listeDecFonctions_, uniteCourante ) ) { syntaxError(); } @@ -156,7 +156,7 @@ void optTailleTableau() { void listeDecFonctions() { openSection( __func__ ); - if( est_premier( _declarationFonction_, uniteCourante ) ) { + if( est_premier( _declarationFonction_, uniteCourante ) || est_premier( _listeDecFonctions_, uniteCourante ) ) { declarationFonction(); listeDecFonctions(); } else if( !est_suivant( _listeDecFonctions_, uniteCourante ) ) { @@ -296,7 +296,7 @@ void instructionBloc() { void listeInstructions() { openSection( __func__ ); - if( est_premier( _instruction_, uniteCourante ) ) { + if( est_premier( _instruction_, uniteCourante ) || est_premier( _listeInstructions_, uniteCourante ) ) { instruction(); listeInstructions(); } else if( !est_suivant( _listeInstructions_, uniteCourante ) ) { @@ -756,7 +756,7 @@ void appelFct() { void listeExpressions() { openSection( __func__ ); - if( est_premier( _expression_, uniteCourante ) ) { + if( est_premier( _expression_, uniteCourante ) || est_premier( _listeExpressions_, uniteCourante ) ) { expression(); listeExpressionsBis(); } else if( !est_suivant( _listeExpressions_, uniteCourante ) ) {