Diff for /rpl/src/analyse_notation_algebrique.c between versions 1.45 and 1.55

version 1.45, 2013/03/23 16:14:39 version 1.55, 2015/01/05 13:12:28
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.13    RPL/2 (R) version 4.1.19
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2015 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 116  analyse_algebrique(struct_processus *s_e Line 116  analyse_algebrique(struct_processus *s_e
   
         if (chaine_algebrique[i] == '"')          if (chaine_algebrique[i] == '"')
         {          {
             presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;              if (chaine_algebrique[i - 1] != '\\')
               {
                   presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;
               }
         }          }
         else if (presence_chaine == d_faux)          else if (presence_chaine == d_faux)
         {          {
Line 238  analyse_algebrique(struct_processus *s_e Line 241  analyse_algebrique(struct_processus *s_e
                     for(i = 0; i < 4; (*(ptr2++)) = (*(ptr1++)), i++);                      for(i = 0; i < 4; (*(ptr2++)) = (*(ptr1++)), i++);
                     (*(ptr2++)) = (*ptr1);                      (*(ptr2++)) = (*ptr1);
                 }                  }
                 else if ((strncmp(instruction_majuscule, " OR ", 4) == 0) &&                  else if (strcmp(instruction_majuscule, " EQV ") == 0)
                         (strlen(instruction_majuscule) == 4))                  {
                       for(i = 0; i < 4; (*(ptr2++)) = (*(ptr1++)), i++);
                       (*(ptr2++)) = (*ptr1);
                   }
                   else if ((strcmp(instruction_majuscule, " OR ") == 0))
                 {                  {
                     for(i = 0; i < 3; (*(ptr2++)) = (*(ptr1++)), i++);                      for(i = 0; i < 3; (*(ptr2++)) = (*(ptr1++)), i++);
                     (*(ptr2++)) = (*ptr1);                      (*(ptr2++)) = (*ptr1);
Line 285  analyse_algebrique(struct_processus *s_e Line 292  analyse_algebrique(struct_processus *s_e
                 }                  }
                 else if (chaine_travail[i] == '"')                  else if (chaine_travail[i] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (i > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[i - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 i++;                  i++;
Line 323  analyse_algebrique(struct_processus *s_e Line 341  analyse_algebrique(struct_processus *s_e
   
                 if (chaine_travail[j] == '"')                  if (chaine_travail[j] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (j > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[j - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 j++;                  j++;
Line 375  analyse_algebrique(struct_processus *s_e Line 404  analyse_algebrique(struct_processus *s_e
                 {                  {
                     if (chaine_centrale[i] == '"')                      if (chaine_centrale[i] == '"')
                     {                      {
                         presence_chaine = (presence_chaine == d_faux)                          if (i > 0)
                                 ? d_vrai : d_faux;                          {
                               if (chaine_centrale[i - 1] != '\\')
                               {
                                   presence_chaine = (presence_chaine == d_faux)
                                           ? d_vrai : d_faux;
                               }
                           }
                           else
                           {
                               presence_chaine = (presence_chaine == d_faux)
                                       ? d_vrai : d_faux;
                           }
   
                         if (i == 1)                          if (i == 1)
                         {                          {
Line 993  analyse_algebrique(struct_processus *s_e Line 1033  analyse_algebrique(struct_processus *s_e
                                 drapeau_modification = d_vrai;                                  drapeau_modification = d_vrai;
                             }                              }
                             else if (((priorite == 1) && (t4 == ' ') &&                              else if (((priorite == 1) && (t4 == ' ') &&
                                     (t3 == 'X') && (t2 == 'O') && (t1 == 'R')                                      (((t3 == 'X') && (t2 == 'O') && (t1 == 'R'))
                                     && (t0 == ' ')) || ((priorite == 2) &&                                      || ((t3 == 'E') && (t2 == 'Q') &&
                                       (t1 == 'V'))) && (t0 == ' '))
                                       || ((priorite == 2) &&
                                     (t4 == ' ') && (t3 == 'A') && (t2 == 'N')                                      (t4 == ' ') && (t3 == 'A') && (t2 == 'N')
                                     && (t1 == 'D') && (t0 == ' ')))                                      && (t1 == 'D') && (t0 == ' ')))
                             {                              {
Line 1183  test_expression_rpn(unsigned char *chain Line 1225  test_expression_rpn(unsigned char *chain
         if (chaine[i - 1] == '"')          if (chaine[i - 1] == '"')
         {          {
             i++;              i++;
             while(chaine[i - 1] != '"')              while(!((chaine[i - 1] == '"') && (chaine[i - 2] != '\\')))
             {              {
                 i++;                  i++;
             }              }
Line 1237  test_expression_rpn(unsigned char *chain Line 1279  test_expression_rpn(unsigned char *chain
                 || ((t0 == ' ') && ((t1 == 'A') || (t1 == 'a')) &&                  || ((t0 == ' ') && ((t1 == 'A') || (t1 == 'a')) &&
                 ((t2 == 'N') || (t2 == 'n')) && ((t3 == 'D') || (t3 == 'd'))                  ((t2 == 'N') || (t2 == 'n')) && ((t3 == 'D') || (t3 == 'd'))
                 && (t4 == ' ')) ||                  && (t4 == ' ')) ||
                   ((t0 == ' ') && ((t1 == 'E') || (t1 == 'e')) &&
                   ((t2 == 'Q') || (t2 == 'q')) && ((t3 == 'V') || (t3 == 'v'))
                   && (t4 == ' ')) ||
                 ((t0 == ' ') && ((t1 == 'O') || (t1 == 'o')) &&                  ((t0 == ' ') && ((t1 == 'O') || (t1 == 'o')) &&
                 ((t2 == 'R') || (t2 == 'r')) && (t3 == ' ')) ||                  ((t2 == 'R') || (t2 == 'r')) && (t3 == ' ')) ||
                 ((t0 == ' ') && ((t1 == 'X') || (t1 == 'x')) &&                  ((t0 == ' ') && ((t1 == 'X') || (t1 == 'x')) &&

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


CVSweb interface <joel.bertrand@systella.fr>