spookyfm / hscript Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/hscript
Automatically exported from code.google.com/p/hscript
Haxe seems to fail to generate code when there is a break in a switch()
statement, but removing that break changes the behavior of the code (it seems
that the "break" is stopping the iteration that is external to the switch)
Example (taken from Parser.hx):
switch( tk ) {
case TComma:
case TPClose: break; //code generation will fail on this line
default: unexpected(tk);
}
Original issue reported on code.google.com by [email protected]
on 22 May 2012 at 7:52
The source code fails to compile using haxe 2.09 because the variable code is
not initialized, the fix is simple:
Parser.hx -> Line 724:
Change
var code;
to
var code = "";
Original issue reported on code.google.com by [email protected]
on 18 May 2012 at 3:23
What steps will reproduce the problem?
Use this code (notice the wrong function call Math.coserror):
var script = "
var sum = 0;
for( a in angles )
sum += Math.coserror(a);
sum;
";
try {
var parser = new hscript.Parser();
var program = parser.parseString(script);
var interp = new hscript.Interp();
interp.variables.set("Math",Math); // share the Math class
interp.variables.set("angles",[0,1,2,3]); // set the angles list
trace( interp.execute(program) );
} catch(e:Dynamic) {
trace("script error");
}
What is the expected output? What do you see instead?
I would expect to catch the error, but instead the app closes and I get this:
....
Called from TestHScript::new, TestHScript.hx 96
Called from Interp::execute, hscript/Interp.hx 194
Called from Interp::exprReturn, hscript/Interp.hx 198
Called from Interp::expr, hscript/Interp.hx 261
Called from Interp::expr, hscript/Interp.hx 307
Called from Interp::forLoop, hscript/Interp.hx 417
Called from Interp::expr, hscript/Interp.hx 269
Called from *::_Function_1_1, hscript/Interp.hx 125
Called from Interp::evalAssignOp, hscript/Interp.hx 133
Called from Interp::expr, hscript/Interp.hx 297
Called from Interp::fcall, hscript/Interp.hx 441
Called from Interp::call, hscript/Interp.hx 445
Called from Reflect::callMethod, /usr/lib/haxe/std/cpp/_std/Reflect.hx 49
Critical Error: Null Object Reference
What version of the product are you using? On what operating system?
Haxe 3.0.0
hscript 2.0.1
OSX 10.6.8
Target: mac
Please provide any additional information below.
It seems there's some null check missing before the Reflect function call.
Original issue reported on code.google.com by [email protected]
on 30 Jul 2013 at 9:51
I think in Interp.hx
function cnew( cl : String, args : Array<Dynamic> ) : Dynamic {
return Type.createInstance(Type.resolveClass(cl),args);
}
Should be:
function cnew( cl : String, args : Array<Dynamic> ) : Dynamic {
return Type.createInstance(variables.get(cl),args);
}
Otherwise constructing non-global classes fails.
Original issue reported on code.google.com by tecteun
on 13 Jul 2011 at 9:58
Using latest flashdevelop, latest haxe, latest hscript, latest everything.
Code:
var script = "1+2";
var parser = new hscript.Parser();
var program = parser.parseString(script);
var interp = new hscript.Interp();
var res = interp.execute(program);
Compile options:
-lib hscript
-lib format
-swf-version 11
-D hscriptPos
Result:
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:206:
characters 14-15 : Identifier 'c' is not part of enum hscript.Const
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:206:
characters 7-16 : hscript.Expr should be hscript.ExprDef
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:206:
characters 7-16 : { pmin : Int, pmax : Int, e : hscript.ExprDef } should be
hscript.ExprDef
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:213:
characters 14-16 : Unknown identifier : id
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:213:
characters 7-17 : hscript.Expr should be hscript.ExprDef
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:213:
characters 7-17 : { pmin : Int, pmax : Int, e : hscript.ExprDef } should be
hscript.ExprDef
C:\Program Files\Motion-Twin\haxe\lib\hscript/1,6/hscript/Interp.hx:221:
characters 12-13 : Unknown identifier : n
Attached full output.
Without "-D hscriptPos" all works good, but not compile other part of project.
Maybe I'm doing something wrong?
Original issue reported on code.google.com by [email protected]
on 17 Sep 2011 at 6:19
Attachments:
What steps will reproduce the problem?
1. install hscript using haxelib
2. include it in a project, using haxe 2.10
3. build
What is the expected output? What do you see instead?
expected -> compiles
i see -> "Class not found: FastList"
This is fixed in SVN, and is basically:
tokens = new FastList<Token>();
to
tokens = new haxe.FastList<Token>();
.
What version of the product are you using? On what operating system?
hscript 2.0, haxe 2.10, on mac
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Mar 2013 at 1:26
What steps will reproduce the problem?
freewizard@FWDev-Pro matrix $ cat Bug.hx
class Bug {
public static function main():Void {
(new hscript.Parser()).parseString("function ok(){ return 0; }\nok();");
(new hscript.Parser()).parseString("function bug(){ \n }\nbug();");
}
}
freewizard@FWDev-Pro matrix $ haxe -lib hscript -neko b.n -main Bug.hx && neko
b.n
Called from ? line 1
Called from Bug.hx line 4
Called from hscript/Parser.hx line 90
Called from hscript/Parser.hx line 108
Called from hscript/Parser.hx line 141
Called from hscript/Parser.hx line 114
Uncaught exception - EUnexpected(bug
)
What is the expected output? What do you see instead?
empty function should be supported
What version of the product are you using? On what operating system?
HaXe 2.0.7
hscript 1.5.2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Feb 2011 at 1:45
What steps will reproduce the problem?
> try to use the callback statement in hscript
What is the expected output? What do you see instead?
> callback statement should work as in haxe, instead I get:
What version of the product are you using? On what operating system?
haxe 2.10, hscript 1.8, windows 7 64 bits
Please provide any additional information below.
It should appear in the "Compared to haXe, limitations are :" list if not
supported.
Cheers !
Thomas
Original issue reported on code.google.com by [email protected]
on 10 Nov 2012 at 3:17
Is there anything preventing hscript being put up onto haxelib for haxe3 rc2+ ?
Original issue reported on code.google.com by [email protected]
on 15 May 2013 at 9:55
class Test {
static function main():Void {
var parser = new hscript.Parser();
var program = parser.parseString("var a = ''; a += 1; a += 1; a;");
trace( new hscript.Interp().execute(program) ); //neko output "11" which is right, but cpp output 2.
}
}
Original issue reported on code.google.com by Andy.onthewings
on 16 May 2011 at 2:27
how about adding a argument to force prevent previously used locals from
getting cleared ?
172,173c172,173
< public function execute( expr : Expr ) : Dynamic {
< locals = new Hash();
---
> public function execute( expr : Expr, clear : Bool = true ) : Dynamic {
> if( clear ) locals = new Hash();
this would allow to save the state of the vm.
Original issue reported on code.google.com by [email protected]
on 23 May 2010 at 8:23
Provide the option to execute an expression without resetting the local
variables. The aim here is to allow the functionality of an REPL loop - an
interactive console that can interact with shared haxe objects, essentially
being run line by line.
Defaults to the existing functionality, and will not change unless "reset" is
specified, and is false.
See discussion here:
http://groups.google.com/group/haxelang/browse_thread/thread/40593201f9f066ad?hl
=en
This is my first time submitting a patch (outside of GitHub), so if there's
anything else I can do please let me know.
Original issue reported on code.google.com by [email protected]
on 6 Mar 2012 at 4:24
Attachments:
Ok, ideally I would be able to write some hScript code like:
hScript:String = "
function moveLeft()
{
// Handle player moving left
}
function moveRight()
{
// Handle player moving right
}
";
And then from within my Haxe be able to call
hscript.interp().moveLeft();
I can't seem to figure out how to make it work. It would be SUPER useful
instead of having to write a separate script for each function...
Original issue reported on code.google.com by [email protected]
on 27 Jun 2014 at 4:08
specify source file name and line offset ( think of <script> in html ) in
Parser.parseString
trace() now come with file and line
Error shows file and line too
Original issue reported on code.google.com by [email protected]
on 24 Jun 2011 at 4:13
Attachments:
What steps will reproduce the problem?
1. Install Haxe3 and hscript 2.0
2. Try this simple example:
for(i in 0...5) { trace("Hi"); }
What is the expected output? What do you see instead?
Expected:
Hi
Hi
Hi
Hi
Hi
Instead I get:
Error: EInvalidIterator(IntIterator)
What version of the product are you using? On what operating system?
Haxe 3, HxCPP 3.0, hscript 2.0 - Windows 7 64bit
Please provide any additional information below.
"for" loops are broken.
using "while" loops is ok
Original issue reported on code.google.com by [email protected]
on 19 Apr 2013 at 2:02
Test.hx:19: test("n(0xBFFFFFFF)",0xBFFFFFFF,{ n : haxe.Int32.toNativeInt });
C:\Motion-Twin\haxe\lib\hscript/1,6/Test.hx:19: characters 23-33 : This integer
is too big to be compiled to a Neko 31-bit integer. Please use a Float instead
Original issue reported on code.google.com by [email protected]
on 17 Apr 2012 at 4:28
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.