- Timestamp:
- 09/20/08 15:36:33 (2 months ago)
- Location:
- v6/smop
- Files:
-
- 7 modified
-
src/native_int.c (modified) (1 diff)
-
src/smop_s1p_array.c (modified) (1 diff)
-
src/smop_s1p_array_iterator.sm0p (modified) (1 diff)
-
src/smop_s1p_emptylist.c (modified) (1 diff)
-
src/smop_s1p_grep.sm0p (modified) (1 diff)
-
src/smop_s1p_map.sm0p (modified) (1 diff)
-
test/35_array_grep.m0ld (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/src/native_int.c
r22272 r22299 41 41 SMOP_RELEASE(interpreter, other); 42 42 SMOP_RELEASE(interpreter,invocant); 43 44 } else if (identifier == SMOP__ID__defined) { 45 ret = SMOP__NATIVE__bool_true; 46 47 } else if (identifier == SMOP__ID__FETCH) { 48 ___NATIVE_CAPTURE_ONLY___; 49 ___INVOCANT_RI_SHOULD_MATCH___; 50 ret = invocant; 43 51 44 52 } else if (identifier == SMOP__ID__infix_num_ge) { -
v6/smop/src/smop_s1p_array.c
r22289 r22299 112 112 } 113 113 114 } else if (identifier == SMOP__ID__defined) { 115 // the array container is defined, the value inside it that maybe not. 116 ret = SMOP__NATIVE__bool_true; 117 114 118 } else if (identifier == SMOP__ID__STORE) { 115 119 resize_array(invocant->array,invocant->index+1); -
v6/smop/src/smop_s1p_array_iterator.sm0p
r22281 r22299 124 124 $void = $interpreter."goto"($back); 125 125 final: 126 $void = $back."setr"(¢SMOP__S1P__E mptyList);126 $void = $back."setr"(¢SMOP__S1P__EndOfIterator); 127 127 $void = $interpreter."goto"($back) 128 128 -
v6/smop/src/smop_s1p_emptylist.c
r22288 r22299 27 27 28 28 } else if (identifier == SMOP__ID__List) { 29 ret = SMOP__S1P__EmptyList; 30 31 } else if (identifier == SMOP__ID__FETCH) { 29 32 ret = SMOP__S1P__EmptyList; 30 33 -
v6/smop/src/smop_s1p_grep.sm0p
r22298 r22299 117 117 my $input_iterator; 118 118 119 fetch_item: 119 120 my $next_item = $input_iterator."prefix:="(); 120 my $list = $next_item."List"(); 121 my $elems = $list."elems"(); 122 my $greater = $elems."infix:>"(0); 123 my $bool = $greater."bool"(); 121 my $bool = $next_item."defined"(); 124 122 if $bool { goto iteration } else { goto end }; 125 123 126 124 iteration: 127 125 my $item = $next_item."FETCH"(); 128 126 my $result = $code."postcircumfix:( )"($item); 129 my $void = $back."setr"($result); 127 my $bool = $result."bool"(); 128 if $bool { goto in } else { goto fetch_item }; 129 130 in: 131 my $void = $back."setr"($item); 130 132 $void = $interpreter."goto"($back); 131 133 132 134 end: 133 135 $void = $back."setr"(¢SMOP__S1P__EndOfIterator); 134 136 $void = $interpreter."goto"($back); 135 137 136 138 }; 137 139 -
v6/smop/src/smop_s1p_map.sm0p
r22288 r22299 114 114 115 115 my $next_item = $input_iterator."prefix:="(); 116 my $list = $next_item."List"(); 117 my $elems = $list."elems"(); 118 my $greater = $elems."infix:>"(0); 119 my $bool = $greater."bool"(); 116 my $bool = $next_item."defined"(); 120 117 if $bool { goto iteration } else { goto end }; 121 118 -
v6/smop/test/35_array_grep.m0ld
r22298 r22299 43 43 my $back = $continuation."back"(); 44 44 45 if $bool { goto in } else { goto out }; 45 if $bool { goto out } else { goto in }; 46 47 in: 48 $void = $back."setr"(¢SMOP__NATIVE__bool_true); 49 $void = $interpreter."goto"($back); 46 50 47 51 out: 48 $void = $back."setr"(¢SMOP__NATIVE__bool_true);49 goto end;50 51 in:52 52 $void = $back."setr"(¢SMOP__NATIVE__bool_false); 53 54 end:55 53 $void = $interpreter."goto"($back); 56 54 })); … … 76 74 77 75 in: 78 $void = $out."print"("ok \n");76 $void = $out."print"("ok - item < 3 \n"); 79 77 goto end; 80 78 81 79 out: 82 $void = $out."print"("not ok \n");80 $void = $out."print"("not ok - item > 3\n"); 83 81 84 82 end:
