Skip to content

Commit

Permalink
seems correct on namespace, do not know why it is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
jimthunderbird committed Feb 18, 2015
1 parent 03ea904 commit 9ac4273
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/PHPtoCExt/Converter/CFuntionCallConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public function convert()

$expectedZephirCode = 'let '.$resultVarName.' = call_c_function('.$firstComp.', '.$secondComp.', '.implode(", ",$cFunctionCallComps).');';
$this->postSearchAndReplace($expectedZephirCode,$cFunctionCallCode);

//now, inject the c source code to the top of the class
$namespace = $classInfo->namespace;
$classPureName = array_pop(explode("\\",$className));
$originalCode = "namespace $namespace;\nclass $classPureName\n{";
$cSourceCode = "jim";
$withCSourceCode = "namespace $namespace;\n%{\n$cSourceCode\n}%\nclass $classPureName\n{";
$this->postSearchAndReplace($originalCode, $withCSourceCode);
}

}
Expand Down

0 comments on commit 9ac4273

Please sign in to comment.