public function parse(string $text) : array
    {
        $index = 0;
        $items = Text::split($text, $this->separator);
        $array = [];
        try {
            foreach ($items as $item) {
                $array[] = $this->syntax->parse($item);
                $index += strlen($item) + 1;
            }
        } catch (ParseException $e) {
            $extra = [
                'type' => 'invalid-item',
                'item' => $item,
                'position' => $e->position()
            ];
            throw new ParseException($this, $text, $index + $e->position(),
                "Unable to parse the item '{$item}'", $extra, $e
            );
        }

        return $array;
    }
public function parse(string $text) : array
    {
        $index = 0;
        $items = Text::split($text, $this->separator);
        $array = [];
        try {
            foreach ($items as $item) {
                $array[] = $this->syntax->parse($item);
                $index += strlen($item) + 1;
            }
        } catch (ParseException $e) {
            $extra = [
                'type' => 'invalid-item',
                'item' => $item,
                'position' => $e->position()
            ];
            throw new ParseException($this, $text, $index + $e->position(),
                "Unable to parse the item '{$item}'", $extra, $e
            );
        }

        return $array;
    }
public function parse ( string $ text ) : array { $ index = 0 ; $ items = Text :: split ( $ text , $ this -> separator ) ; $ array = [ ] ; try { foreach ( $ items as $ item ) { $ array [ ] = $ this -> syntax -> parse ( $ item ) ; $ index += strlen ( $ item ) + 1 ; } } catch ( ParseException $ e ) { $ extra = [ 'type' => 'invalid-item' , 'item' => $ item , 'position' => $ e -> position ( ) ] ; throw new ParseException ( $ this , $ text , $ index + $ e -> position ( ) , "Unable to parse the item '{$item}'" , $ extra , $ e ) ; } return $ array ; }
Transforms a string to array based on
the syntax or throws a ParseException.

@param  string $text the string to parse
@return array

@throws Tarsana\Syntax\Exceptions\ParseException
Transforms a string to array based on the syntax or throws a ParseException .