+ # debut de commande commentarisee : on cree un objet commande_commentarisee_courante
+ commande_commentarisee_courante = COMMANDE_COMMENTARISEE(self)
+ commande_commentarisee_courante.appendText(ligne)
+
+ #on passe a la ligne suivante
+ continue
+
+ if pattern_comment.match(ligne):
+ #commentaire ordinaire avec seulement des blancs devant
+ if commande_commentarisee_courante :
+ # commande_commentarisee en cours : on la clot
+ commande_commentarisee_courante = None
+
+ if commande_courante :
+ # il s'agit d'un commentaire a l'interieur d'une commande --> on ne fait rien de special
+ #on l'ajoute au texte de la commande
+ commande_courante.appendText(ligne)
+ elif commentaire_courant :
+ # il s'agit de la nieme ligne d'un commentaire entre deux commandes
+ # --> on ajoute cette ligne au commentaire courant
+ commentaire_courant.appendText(ligne)
+ else :
+ # il s'agit d'un nouveau commentaire entre deux commandes
+ # --> on le cree et il devient le commentaire courant
+ commentaire_courant = COMMENTAIRE(self)
+ commentaire_courant.appendText(ligne)
+
+ #on passe a la ligne suivante
+ continue
+
+ # la ligne contient des donnees autre qu'un eventuel commentaire
+ if commentaire_courant :
+ # on clot un eventuel commentaire courant
+ commentaire_courant = None
+
+ if commande_commentarisee_courante :
+ # on clot une eventuelle commande commentarisee courante
+ commande_commentarisee_courante = None
+
+ if commande_courante :
+ #on a une commande en cours. On l'enrichit ou on la termine
+ commande_courante.appendText(ligne)
+ if not linecontinueRE.search(line) \
+ and (hangingBraces == emptyHangingBraces) \
+ and not hangingComments:
+ #la commande est terminee
+ self.analyseReel(commande_courante.texte)
+ commande_courante = None
+
+ #on passe a la ligne suivante
+ continue
+
+ if affectation_courante != None :
+ #poursuite d'une affectation
+ affectation_courante.appendText(ligne)
+ if not linecontinueRE.search(line) \
+ and (hangingBraces == emptyHangingBraces) \
+ and not hangingComments:
+ #L'affectation est terminee
+ affectation_courante=None
+ #on passe a la ligne suivante
+ continue
+
+ # il peut s'agir d'une commande ou d'une affectation ...
+ # ou d'un EVAL !!!
+ if self.isEval(ligne):
+ # --> affectation de type EVAL
+ if affectation_courante : affectation_courante = None
+ affectation = AFFECTATION_EVAL(self)
+ affectation.appendText(ligne)
+ #on passe a la ligne suivante
+ continue
+
+ if self.isAffectation(ligne):
+ #print( '--> affectation')
+ text=ligne
+ #traitement des commentaires en fin de ligne
+ compos=line.find(u"#")
+ if compos > 2:
+ #commentaire en fin de ligne
+ #on cree un nouveau commentaire avant le parametre
+ COMMENTAIRE(self).appendText(ligne[compos:])
+ text=ligne[:compos]
+ #si plusieurs instructions separees par des ; sur la meme ligne
+ inspos=line.find(u";")
+ if inspos > 2:
+ #on garde seulement la premiere partie de la ligne
+ #si on a que des blancs apres le point virgule
+ if text[inspos:].strip() == ";":
+ text=text[:inspos]