Commit 3c71e1a7 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Pas de reparsing d'une fonction déjà analysée.

trim sur le nom des fonctions
parent e82f3990
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ class Formule
        /* Détection de fonctions */
        $next = $this->t($i + 1);
        if ($next['type'] === 'sep' && $next['name'] === '(') {
            $this->tw(['type' => 'function', 'name' => $v], $i);
            $this->tw(['type' => 'function', 'name' => trim($v)], $i);
        }
    }

@@ -392,6 +392,11 @@ class Formule
        $currentExpr = 0;
        $end         = count($expr);

        if (!(isset($expr[$i + 1]) && $expr[$i + 1]['type'] === 'sep' && $expr[$i + 1]['name'] === '(')){
            // Fonction déjà analysée
            return;
        }
        
        unset($expr[$i + 1]); // on supprime la parenthèse ouvrante
        for ($c = $i + 2; $c < $end; $c++) {
            $t = $expr[$c];