Compare commits

..
2 Commits
Author SHA1 Message Date
Nicolas Cannasse 01f3030473 2.0.7 (close #47) 2016-04-03 20:10:18 +02:00
Nicolas Cannasse 98c08becd6 fixes for -D hscriptPos 2016-04-03 20:09:39 +02:00
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
"url": "https://github.com/HaxeFoundation/hscript", "url": "https://github.com/HaxeFoundation/hscript",
"license": "MIT", "license": "MIT",
"description": "Haxe Script is a scripting engine for a subset of the Haxe language", "description": "Haxe Script is a scripting engine for a subset of the Haxe language",
"version": "2.0.6", "version": "2.0.7",
"releasenote": "fixes for haxe 3.3, use property access by default", "releasenote": "fixes for haxe 3.3, use property access by default",
"contributors": ["ncannasse"] "contributors": ["ncannasse"]
} }
+8
View File
@@ -130,6 +130,9 @@ class Bytes {
} }
function doEncode( e : Expr ) { function doEncode( e : Expr ) {
#if hscriptPos
var e = e.e;
#end
bout.addByte(Type.enumIndex(e)); bout.addByte(Type.enumIndex(e));
switch( e ) { switch( e ) {
case EConst(c): case EConst(c):
@@ -234,6 +237,11 @@ class Bytes {
} }
function doDecode() : Expr { function doDecode() : Expr {
#if hscriptPos
return { e : _doDecode(), pmin : 0, pmax : 0 };
}
function _doDecode() : ExprDef {
#end
return switch( bin.get(pin++) ) { return switch( bin.get(pin++) ) {
case 0: case 0:
EConst( doDecodeConst() ); EConst( doDecodeConst() );
+4
View File
@@ -738,7 +738,11 @@ class Parser {
case TOp(op): case TOp(op):
if( op == ">" ) break; if( op == ">" ) break;
if( op.charCodeAt(0) == ">".code ) { if( op.charCodeAt(0) == ">".code ) {
#if hscriptPos
tokens.add({ t : TOp(op.substr(1)), min : tokenMax - op.length - 1, max : tokenMax });
#else
tokens.add(TOp(op.substr(1))); tokens.add(TOp(op.substr(1)));
#end
break; break;
} }
default: default: