Skip to content

Commit

Permalink
small fixes, including string upcase/downcase
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfitz committed Sep 18, 2015
1 parent c4ea310 commit 2b7ec95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion genrb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ let reserved =
"begin";"rescue";"end";

"Sys";"File";
"next";
];
h

Expand Down Expand Up @@ -1465,7 +1466,7 @@ let generate_field ctx static f =
print ctx "def %s(" (loop f.cf_meta);
concat ctx "," (fun (arg,o,t) ->
let tstr = type_str ctx t p in
print ctx "%s" arg;
print ctx "%s" (s_ident arg);
if o then print ctx " = %s" (default_value tstr);
) args;
print ctx ") puts \"Abstract %s.%s called\" end" (tweak_class_name (snd ctx.curclass.cl_path)) (loop f.cf_meta);
Expand Down
11 changes: 9 additions & 2 deletions std/rb/_std/String.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@
var length(default,null) : Int;

function new(string:String) : Void;
function toUpperCase() : String;
function toLowerCase() : String;

inline function toUpperCase() : String {
return untyped __dotcall__(this,"upcase");
}

inline function toLowerCase() : String {
return untyped __dotcall__(this,"downcase");
}

inline function charAt( index : Int) : String {
return untyped __get__(this,index);
}
Expand Down

0 comments on commit 2b7ec95

Please sign in to comment.