<div class="span6"> <form name='editor' id='editor' action='punga.php' method='post'> <textarea rows='10' class='span6' name='code' placeholder='enter your code here'><?php echo $_POST['code']; ?> </textarea> <a onClick='document.forms["editor"].submit()' class='btn'>Evaluate</a> </form> </div> <div class="span6"> <?php require_once "parable.php"; $bootstrap = explode("\n", $_POST['code']); foreach ($bootstrap as $src) { if (strlen(trim($src)) > 0) { $s = compile($src, request_slice()); interpret($s); } } if (!empty($errors)) { echo "<div class='alert alert-error'>"; foreach ($errors as $err) { echo "<tt>{$err}</tt><br>\n"; } $errors = array(); echo "</div>"; } $TYPE_NUMBER = 100; $TYPE_STRING = 200; $TYPE_CHARACTER = 300; $TYPE_FUNCTION = 400;
function parse_bootstrap($lines) { foreach ($lines as $src) { if (strlen(trim($src)) > 0) { $s = compile($src, request_slice()); interpret($s); } } }