Diff for /rpl/src/compilation.c between versions 1.55 and 1.56

version 1.55, 2013/02/27 17:11:39 version 1.56, 2013/03/17 22:26:43
Line 1080  recherche_instruction_suivante(struct_pr Line 1080  recherche_instruction_suivante(struct_pr
         {          {
             case ']' :              case ']' :
             case '}' :              case '}' :
               {
                   break;
               }
   
             case ')' :              case ')' :
             {              {
                 erreur_format = d_ex_syntaxe;                  erreur_format = d_ex_syntaxe;
Line 1418  recherche_instruction_suivante(struct_pr Line 1422  recherche_instruction_suivante(struct_pr
                 while((niveau != 0) && ((*pointeur_caractere_courant) !=                  while((niveau != 0) && ((*pointeur_caractere_courant) !=
                         d_code_fin_chaine))                          d_code_fin_chaine))
                 {                  {
                     switch(*pointeur_caractere_courant)                      (*s_etat_processus).position_courante =
                               pointeur_caractere_courant
                               - (*s_etat_processus).definitions_chainees;
   
                       if (recherche_instruction_suivante(s_etat_processus)
                               == d_erreur)
                     {                      {
                         case '{' :                          if ((*s_etat_processus).instruction_courante
                                   != NULL)
                         {                          {
                             if (niveau_annexe == 0)                              free((*s_etat_processus).instruction_courante);
                             {  
                                 niveau++;  
                             }  
                             else  
                             {  
                                 erreur_analyse = d_ex_syntaxe;  
                             }  
   
                             break;  
                         }                          }
   
                         case '}' :                          return(d_erreur);
                         {                      }
                             if (niveau_annexe == 0)  
                             {  
                                 niveau--;  
                             }  
                             else  
                             {  
                                 erreur_analyse = d_ex_syntaxe;  
                             }  
   
                             break;                      pointeur_caractere_courant =
                         }                              (*s_etat_processus).definitions_chainees +
                               (*s_etat_processus).position_courante;
   
                         case '[' :                      if (strcmp((*s_etat_processus).instruction_courante, "{")
                               == 0)
                       {
                           if (niveau_annexe == 0)
                         {                          {
                             niveau_annexe++;                              niveau++;
   
                             if (niveau_annexe > 2)  
                             {  
                                 erreur_analyse = d_ex_syntaxe;  
                             }  
   
                             break;  
                         }                          }
                           else
                         case ']' :  
                         {                          {
                             niveau_annexe--;                              erreur_analyse = d_ex_syntaxe;
                           }
                             if (niveau_annexe < 0)                      }
                             {                      else if (strcmp((*s_etat_processus).instruction_courante,
                                 erreur_analyse = d_ex_syntaxe;                              "}") == 0)
                             }                      {
                           if (niveau_annexe == 0)
                           {
                               niveau--;
                           }
                           else
                           {
                               erreur_analyse = d_ex_syntaxe;
                           }
                       }
                       else if (strcmp((*s_etat_processus).instruction_courante,
                               "<[") == 0)
                       {
                           niveau++;
                       }
                       else if (strcmp((*s_etat_processus).instruction_courante,
                               "]>") == 0)
                       {
                           niveau--;
                       }
                       else if (strcmp((*s_etat_processus).instruction_courante,
                               "[") == 0)
                       {
                           niveau_annexe++;
   
                             break;                          if (niveau_annexe > 2)
                           {
                               erreur_analyse = d_ex_syntaxe;
                         }                          }
                       }
                       else if (strcmp((*s_etat_processus).instruction_courante,
                               "[[") == 0)
                       {
                           niveau_annexe += 2;
   
                         case '"' :                          if (niveau_annexe > 2)
                         {                          {
                             if (niveau_annexe == 0)                              erreur_analyse = d_ex_syntaxe;
                             {                          }
                                 pointeur_caractere_courant++;                      }
                       else if (strcmp((*s_etat_processus).instruction_courante,
                               "]") == 0)
                       {
                           niveau_annexe--;
   
                                 while((*pointeur_caractere_courant != '"') &&                          if (niveau_annexe < 0)
                                         ((*pointeur_caractere_courant) !=                          {
                                         d_code_fin_chaine))                              erreur_analyse = d_ex_syntaxe;
                                 {                          }
                                     if (*pointeur_caractere_courant == '\\')                      }
                                     {                      else if (strcmp((*s_etat_processus).instruction_courante,
                                         pointeur_caractere_courant++;                              "]]") == 0)
                       {
                                         switch(*pointeur_caractere_courant)                          niveau_annexe -= 2;
                                         {  
                                             case '\\' :  
                                             case '"' :  
                                             {  
                                                 pointeur_caractere_courant++;  
                                                 break;  
                                             }  
                                         }  
                                     }  
                                     else  
                                     {  
                                         pointeur_caractere_courant++;  
                                     }  
                                 }  
                             }  
                             else  
                             {  
                                 erreur_analyse = d_ex_syntaxe;  
                             }  
   
                             break;                          if (niveau_annexe < 0)
                           {
                               erreur_analyse = d_ex_syntaxe;
                           }
                       }
                       else if ((*s_etat_processus).instruction_courante[0] == '"')
                       {
                           if (niveau_annexe != 0)
                           {
                               erreur_analyse = d_ex_syntaxe;
                         }                          }
                     }                      }
   
                     pointeur_caractere_courant++;                      free((*s_etat_processus).instruction_courante);
                 }                  }
   
                 if ((niveau != 0) || (niveau_annexe != 0))                  if ((niveau != 0) || (niveau_annexe != 0))
Line 1605  recherche_instruction_suivante(struct_pr Line 1618  recherche_instruction_suivante(struct_pr
             {              {
                 if (((*s_etat_processus).autorisation_empilement_programme                  if (((*s_etat_processus).autorisation_empilement_programme
                         == 'Y') && ((*pointeur_caractere_courant) == '<'))                          == 'Y') && ((*pointeur_caractere_courant) == '<'))
                 {                  { // Cas << >>
                     if (pointeur_debut_instruction !=                      if (pointeur_debut_instruction !=
                             (pointeur_caractere_courant - 1))                              (pointeur_caractere_courant - 1))
                     {                      {
Line 1617  recherche_instruction_suivante(struct_pr Line 1630  recherche_instruction_suivante(struct_pr
                     while((niveau != 0) && ((*pointeur_caractere_courant) !=                      while((niveau != 0) && ((*pointeur_caractere_courant) !=
                             d_code_fin_chaine))                              d_code_fin_chaine))
                     {                      {
                         if (((*pointeur_caractere_courant) == '<') &&                          (*s_etat_processus).position_courante =
                                 ((*(pointeur_caractere_courant + 1)) == '<'))                                  pointeur_caractere_courant
                                   - (*s_etat_processus).definitions_chainees;
   
                           if (recherche_instruction_suivante(s_etat_processus)
                                   == d_erreur)
                         {                          {
                             niveau++;                              if ((*s_etat_processus).instruction_courante
                             pointeur_caractere_courant++;                                      != NULL)
                               {
                                   free((*s_etat_processus).instruction_courante);
                               }
   
                               return(d_erreur);
                         }                          }
                         else if (((*pointeur_caractere_courant) == '>') &&  
                                 ((*(pointeur_caractere_courant + 1)) == '>'))                          pointeur_caractere_courant =
                                   (*s_etat_processus).definitions_chainees +
                                   (*s_etat_processus).position_courante;
   
                           if (strcmp((*s_etat_processus).instruction_courante,
                                   "<<") == 0)
                         {                          {
                             niveau--;                              niveau++;
                             pointeur_caractere_courant++;  
                         }                          }
                         else if ((*pointeur_caractere_courant) == '"')                          else if (strcmp((*s_etat_processus)
                                   .instruction_courante, ">>") == 0)
                         {                          {
                             pointeur_caractere_courant++;                              niveau--;
   
                             while((*pointeur_caractere_courant != '"') &&  
                                     ((*pointeur_caractere_courant) !=  
                                     d_code_fin_chaine))  
                             {  
                                 if (*pointeur_caractere_courant == '\\')  
                                 {  
                                     pointeur_caractere_courant++;  
   
                                     switch(*pointeur_caractere_courant)  
                                     {  
                                         case '\\' :  
                                         case '"' :  
                                         {  
                                             pointeur_caractere_courant++;  
                                             break;  
                                         }  
                                     }  
                                 }  
                                 else  
                                 {  
                                     pointeur_caractere_courant++;  
                                 }  
                             }  
                         }                          }
   
                         pointeur_caractere_courant++;                          free((*s_etat_processus).instruction_courante);
                     }                      }
   
                     if (niveau != 0)                      if (niveau != 0)
Line 1669  recherche_instruction_suivante(struct_pr Line 1672  recherche_instruction_suivante(struct_pr
                     drapeau_fin_objet = d_vrai;                      drapeau_fin_objet = d_vrai;
                 }                  }
                 else if ((*pointeur_caractere_courant) == '[')                  else if ((*pointeur_caractere_courant) == '[')
                 {                  { // Cas <[ ]>
                     if (pointeur_debut_instruction !=                      if (pointeur_debut_instruction !=
                             (pointeur_caractere_courant - 1))                              (pointeur_caractere_courant - 1))
                     {                      {

Removed from v.1.55  
changed lines
  Added in v.1.56


CVSweb interface <joel.bertrand@systella.fr>