Scriptor / pharen

Lisp to PHP Compiler
http://pharen.org
BSD 3-Clause "New" or "Revised" License
218 stars 31 forks source link

(load file) is broken for more than one level (load file 1(load file 2 (load file 3))) for a once off compile #57

Open thinkadoo opened 10 years ago

thinkadoo commented 10 years ago

What I am seeing is:

pharen (load file 2 (load file 3)) -- OK

pharen (load file 1(load file 2 )) -- OK

pharen (load file 1(load file 2 (load file 3))) -- BREAK

If I compile the file which in turn loads other files the (load file 1) link is broken

Reference project: https://github.com/thinkadoo/lispy

$pharen index.phn

; index.phn (load header) (load lispy) (load footer)

// index.php <?php require_once('/Applications/pharen/lang.php'); use Pharen\Lexical as Lexical; Lexical::$scopes['_index'] = array(); include("header.php"); include("errorview.php"); <<--- include("footer.php");

-> errorview is the last load link from level 2 to level 3

The only way to get around the problem is to remove the level 3 links in the level 2 doc temporarily and then compiling from level 1. Then to enable the level 2 links to level 3 but only compile the level 2 document, which is lispy.phn in this case.