Created
January 20, 2011 19:42
-
-
Save francescoagati/788485 to your computer and use it in GitHub Desktop.
pharen php evalutation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PhpNode extends SpecialForm{ | |
public $body_index = 2; | |
public function compile_statement(){ | |
$body = $this->compile_body(); | |
eval("\$body=$body"); | |
echo $body; | |
return $this->format_line($body); | |
} | |
} | |
...... | |
"php" => array("PhpNode", "LeafNode", "LeafNode", self::$values), | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(write-variable-macro) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro write-variable-macro () | |
(def var1 "value var 1") | |
'(php (. "" ~var1 "" ~var1 " " ~var1)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment