Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement nqp::ordat.
  • Loading branch information
pmurias committed Feb 7, 2015
1 parent d065d45 commit 21fee9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion TODO
Expand Up @@ -27,7 +27,6 @@ We need to write tests (if they don't already exist in t/nqp)
- nfafromstatelist
- nfarunalt
- nfarunproto
- ordat - EASY
- pop_i
- push_i
- push_s
Expand Down
1 change: 1 addition & 0 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -415,6 +415,7 @@ class QAST::OperationsJS {
add_simple_op('flip', $T_STR, [$T_STR], sub ($string) {"$string.split('').reverse().join('')"});

add_simple_op('ord', $T_INT, [$T_STR, $T_INT], sub ($string, $pos='0') {"$string.charCodeAt($pos)"});
%ops<ordat> := %ops<ord>;

add_simple_op('null', $T_OBJ, [], sub () {"null"});
add_simple_op('isnull', $T_BOOL, [$T_OBJ], sub ($obj) {"($obj === null)"});
Expand Down

0 comments on commit 21fee9b

Please sign in to comment.