fixed issue #2

This commit is contained in:
Nicolas Cannasse
2011-02-24 06:58:00 +00:00
parent 88371134be
commit a6038e7474
5 changed files with 58 additions and 16 deletions
+2 -1
View File
@@ -71,7 +71,8 @@ class Test {
test("var i=0; if( i++ > 0 ) i=3; i",1);
test("var a = 5/2; a",2.5);
test("{ x = 3; x; }", 3);
test("{ x : 3, y : {} }.x",3);
test("{ x : 3, y : {} }.x", 3);
test("function bug(){ \n }\nbug().x", null);
trace("Done");
}
+4 -4
View File
@@ -1,5 +1,5 @@
# HScript
-swf9 hscript.swf
-swf hscript.swf
-swf-version 9
-swf-header 800:600:30:FFFFFF
--flash-strict
-main Test
-debug
-10
View File
@@ -1,10 +0,0 @@
<haxe selected="0">
<output name="HScript" mode="swf9" out="hscript.swf" class="Test" lib="" cmd="" main="True" debug="True"></output>
<files path="/">
<file path="hscript\Bytes.hx" />
<file path="hscript\Expr.hx" />
<file path="hscript\Interp.hx" />
<file path="hscript\Parser.hx" />
<file path="Test.hx" />
</files>
</haxe>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- Output SWF options -->
<output>
<movie disabled="False" />
<movie input="" />
<movie path="hscript.swf" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
<movie version="9" />
<movie background="#FFFFFF" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
<!-- example: <class path="..." /> -->
</classpaths>
<!-- Build options -->
<build>
<option directives="" />
<option flashStrict="True" />
<option mainClass="Test" />
<option enabledebug="False" />
<option additional="" />
</build>
<!-- haxelib libraries -->
<haxelib>
<!-- example: <library name="..." /> -->
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<!-- example: <compile path="..." /> -->
</compileTargets>
<!-- Assets to embed into the output SWF -->
<library>
<!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
</library>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
<!-- example: <hidden path="..." /> -->
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand />
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Default" />
</options>
</project>
+1 -1
View File
@@ -116,7 +116,7 @@ class Parser {
function isBlock(e) {
return switch( e ) {
case EBlock(_): true;
case EBlock(_), EObject(_): true;
case EFunction(_,e,_): isBlock(e);
case EVar(_,e): e != null && isBlock(e);
case EIf(_,e1,e2): if( e2 != null ) isBlock(e2) else isBlock(e1);