protected function createLocation(array $ast): ?Location
    {
        return isset($ast['loc']['start'], $ast['loc']['end'])
            ? new Location($ast['loc']['start'], $ast['loc']['end'], $ast['loc']['source'] ?? null)
            : null;
    }
protected function createLocation(array $ast): ?Location
    {
        return isset($ast['loc']['start'], $ast['loc']['end'])
            ? new Location($ast['loc']['start'], $ast['loc']['end'], $ast['loc']['source'] ?? null)
            : null;
    }
protected function createLocation ( array $ ast ) : ? Location { return isset ( $ ast [ 'loc' ] [ 'start' ] , $ ast [ 'loc' ] [ 'end' ] ) ? new Location ( $ ast [ 'loc' ] [ 'start' ] , $ ast [ 'loc' ] [ 'end' ] , $ ast [ 'loc' ] [ 'source' ] ?? null ) : null ; }
Creates a location object.

@param array $ast
@return Location|null
Creates a location object .