Permalink
Browse files

update make.php to new paths

  • Loading branch information...
1 parent 80af3e9 commit 206966d863a3e3bafefaa4d4237fc21327bbd400 @alxlit committed Apr 7, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 make.php
View
@@ -5,8 +5,6 @@
// Disable output.
ini_set('implicit_flush', false);
-function clean() {}
-
function init()
{
$arg = array_slice($_SERVER['argv'], 1);
@@ -25,7 +23,7 @@ function make()
require 'vendor/ParserGenerator/ParserGenerator.php';
$source = 'grammar';
- $target = 'coffeescript/classes/parser.php';
+ $target = 'src/CoffeeScript/Parser.php';
// Lemon takes arguments on the command line.
$_SERVER['argv'] = $argv = array('-s', ROOT.$source.'.y');
@@ -75,7 +73,13 @@ function make()
$content = file_get_contents(ROOT.$source.'.php');
// Add namespace declaration.
- $content = str_replace('<?php', "<?php\nnamespace CoffeeScript;\nuse \ArrayAccess as ArrayAccess;", $content);
+ $content = strtr($content, array(
+ '<?php' =>
+ "<?php\n"
+ . "namespace CoffeeScript;\n"
+ . "use \ArrayAccess as ArrayAccess;\n"
+ . "Init::init();\n"
+ ));
// Write.
file_put_contents(ROOT.$target, $content);

0 comments on commit 206966d

Please sign in to comment.