+ //Check if we have a bundle path
+ if ($output[0] == '@') {
+ //Check that we have a / separator between bundle name and path
+ if (($pos = strpos($output, '/')) === false) {
+ throw new Error(sprintf('Invalid output path "%s"', $output), $token->getLine(), $stream->getSourceContext());
+ }
+ //Resolve bundle prefix
+ $output = $this->locator->locate(substr($output, 0, $pos)).substr($output, $pos + 1);
+ }
+
+ //Create output dir if not present
+ if (!is_dir($dir = dirname($output))) {