code: public function compileSource($source, $name = null)
      {
          if (!$source instanceof Twig_Source) {
              @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED);
              $source = new Twig_Source($source, $name);
          }
  
          try {
              return $this->compile($this->parse($this->tokenize($source)));
          } catch (Twig_Error $e) {
              $e->setSourceContext($source);
              throw $e;
          } catch (Exception $e) {
              throw new Twig_Error_Syntax(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
          }
      }
docs: Compiles a template source code.
  
  @param string|Twig_Source $source The template source code
  @param string             $name   The template name (deprecated)
  
  @return string The compiled PHP source code
  
  @throws Twig_Error_Syntax When there was an error during tokenizing, parsing or compiling