Skip to content

Commit

Permalink
allowed > 64k res
Browse files Browse the repository at this point in the history
git-svn-id: http://haxe.googlecode.com/svn/trunk@1451 f16182fa-f095-11de-8f43-4547254af6c6
  • Loading branch information
ncannasse committed Sep 8, 2006
1 parent 6f5a96a commit 2be6a38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
fixed scope bug in try/catch with Flash9
added remoting over XMLSocket and LocalConnection for Flash9
fixed Std.is(*,null) = false
allowed >64K haXe/neko strings
(TODO) -debug support for both Flash and JS
(TODO) resources in Flash9

Expand Down
9 changes: 8 additions & 1 deletion genneko.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,19 @@ let gen_type_path p (path,t) =
let epath = List.fold_left (fun e path -> field p e path) (ident p path) l in
field p epath t

let rec gen_big_string ctx p s =
let max = 1 lsl 16 - 1 in
if String.length s > max then
(EBinop ("+",str p (String.sub s 0 max),gen_big_string ctx p (String.sub s max (String.length s - max))),p)
else
str p s

let gen_constant ctx pe c =
let p = pos ctx pe in
match c with
| TInt i -> (try int p (Int32.to_int i) with _ -> Typer.error "This integer is too big to be compiled to a Neko 31-bit integer. Please use a Float instead" pe)
| TFloat f -> (EConst (Float f),p)
| TString s -> call p (field p (ident p "String") "new") [str p s]
| TString s -> call p (field p (ident p "String") "new") [gen_big_string ctx p s]
| TBool b -> (EConst (if b then True else False),p)
| TNull -> null p
| TThis -> this p
Expand Down

0 comments on commit 2be6a38

Please sign in to comment.