Coder Social home page Coder Social logo

hscript's People

Watchers

 avatar

hscript's Issues

compiling error with some options

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

  • Merged into: #4

Attachments:

empty function cause parsing error

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

"callback" statement not available in hscript ?

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

allow state save

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

Test fails with 2.09

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

Patch for /trunk/hscript/Interp.hx

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:

Is it possible to call an hScript function from Haxe?

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

make hscriptPos work

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:

Error: EInvalidIterator(IntIterator) in hscript 2.0 and Haxe 3

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

as3 source code generation fails on Parser.hx

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

Uncatchable error when calling wrong method on object

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

haxelib entry

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

constructing non global class (new)

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

cpp target empty string may be treated as number

    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

haxelib version 2.0 of hscript doesn't work for haxe 2.10 (haxe 3.0 compat)

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.