Author: coke Date: Fri Jul 18 15:32:46 2008 New Revision: 29600 Modified: trunk/languages/tcl/runtime/builtin/dict.pir trunk/languages/tcl/runtime/builtin/if.pir trunk/languages/tcl/runtime/conversions.pir trunk/languages/tcl/src/builtin/for.tmt trunk/languages/tcl/src/builtin/while.tmt trunk/languages/tcl/src/grammar/expr/functions.pir trunk/languages/tcl/src/grammar/expr/operators.pir trunk/languages/tcl/src/grammar/expr/past2pir.tg trunk/languages/tcl/tools/gen_inline.pl
Log: [tcl] convert _tcl;__boolean to _tcl;toBoolean for http://code.google.com/p/partcl/issues/detail?id=58 Modified: trunk/languages/tcl/runtime/builtin/dict.pir ============================================================================== --- trunk/languages/tcl/runtime/builtin/dict.pir (original) +++ trunk/languages/tcl/runtime/builtin/dict.pir Fri Jul 18 15:32:46 2008 @@ -205,10 +205,10 @@ options[1] = 'script' options[2] = 'value' - .local pmc select_option, __script, __boolean + .local pmc select_option, __script, toBoolean select_option = get_root_global ['_tcl'], 'select_option' __script = get_root_global ['_tcl'], '__script' - __boolean = get_root_global ['_tcl'], '__boolean' + toBoolean = get_root_global ['_tcl'], 'toBoolean' .local pmc option option = shift argv option = select_option(options, option, 'filterType') @@ -283,7 +283,7 @@ push_eh body_handler $P1 = body_proc() pop_eh - $P1 = __boolean($P1) + $P1 = toBoolean($P1) unless $P1 goto script_loop retval[check_key] = check_value goto script_loop Modified: trunk/languages/tcl/runtime/builtin/if.pir ============================================================================== --- trunk/languages/tcl/runtime/builtin/if.pir (original) +++ trunk/languages/tcl/runtime/builtin/if.pir Fri Jul 18 15:32:46 2008 @@ -90,9 +90,9 @@ arg_end: # now we can do the actual evaluation - .local pmc __script, __boolean + .local pmc __script, toBoolean __script = get_root_global ['_tcl'], '__script' - __boolean = get_root_global ['_tcl'], '__boolean' + toBoolean = get_root_global ['_tcl'], 'toBoolean' .local pmc cond .local string code @@ -102,7 +102,7 @@ loop: $P1 = cond() - $I1 = __boolean($P1) + $I1 = toBoolean($P1) unless $I1 goto next $P0 = __script(code, 'ns'=>ns) .return $P0() Modified: trunk/languages/tcl/runtime/conversions.pir ============================================================================== --- trunk/languages/tcl/runtime/conversions.pir (original) +++ trunk/languages/tcl/runtime/conversions.pir Fri Jul 18 15:32:46 2008 @@ -528,14 +528,14 @@ .return(ns_name) .end -=head2 _Tcl::__boolean +=head2 _Tcl::toBoolean Given a string, return its boolean value if it's a valid boolean. Otherwise, throw an exception. =cut -.sub __boolean +.sub toBoolean .param pmc value .local string lc Modified: trunk/languages/tcl/src/builtin/for.tmt ============================================================================== --- trunk/languages/tcl/src/builtin/for.tmt (original) +++ trunk/languages/tcl/src/builtin/for.tmt Fri Jul 18 15:32:46 2008 @@ -1,11 +1,11 @@ [for start:script test:expr next:script command:script] - .local pmc __boolean - __boolean = get_root_global ['_tcl'], '__boolean' + .local pmc toBoolean + toBoolean = get_root_global ['_tcl'], 'toBoolean' $start loop: $P0 = $test - $I0 = __boolean($P0) + $I0 = toBoolean($P0) unless $I0 goto done push_eh command_exception $command Modified: trunk/languages/tcl/src/builtin/while.tmt ============================================================================== --- trunk/languages/tcl/src/builtin/while.tmt (original) +++ trunk/languages/tcl/src/builtin/while.tmt Fri Jul 18 15:32:46 2008 @@ -1,10 +1,10 @@ [while test:expr command:script] - .local pmc __boolean - __boolean = get_root_global ['_tcl'], '__boolean' + .local pmc toBoolean + toBoolean = get_root_global ['_tcl'], 'toBoolean' while_loop: $P0 = $test - $I0 = __boolean($P0) + $I0 = toBoolean($P0) unless $I0 goto while_loop_done push_eh while_loop_exception Modified: trunk/languages/tcl/src/grammar/expr/functions.pir ============================================================================== --- trunk/languages/tcl/src/grammar/expr/functions.pir (original) +++ trunk/languages/tcl/src/grammar/expr/functions.pir Fri Jul 18 15:32:46 2008 @@ -137,10 +137,10 @@ .sub '&bool' .param pmc a - .local pmc __boolean - __boolean = get_root_global ['_tcl'], '__boolean' + .local pmc toBoolean + toBoolean = get_root_global ['_tcl'], 'toBoolean' - .return __boolean(a) + .return toBoolean(a) .end .sub '&ceil' Modified: trunk/languages/tcl/src/grammar/expr/operators.pir ============================================================================== --- trunk/languages/tcl/src/grammar/expr/operators.pir (original) +++ trunk/languages/tcl/src/grammar/expr/operators.pir Fri Jul 18 15:32:46 2008 @@ -118,11 +118,11 @@ .sub 'prefix:!' :multi(String) .param pmc a - .local pmc __boolean - __boolean = get_root_global ['_tcl'], '__boolean' + .local pmc toBoolean + toBoolean = get_root_global ['_tcl'], 'toBoolean' push_eh is_string - a = __boolean(a) + a = toBoolean(a) pop_eh $I0 = a Modified: trunk/languages/tcl/src/grammar/expr/past2pir.tg ============================================================================== --- trunk/languages/tcl/src/grammar/expr/past2pir.tg (original) +++ trunk/languages/tcl/src/grammar/expr/past2pir.tg Fri Jul 18 15:32:46 2008 @@ -416,8 +416,8 @@ .local string cond_result, then_result, else_result pir = new 'CodeString' - pir.emit(' .local pmc __boolean') - pir.emit(' __boolean = get_root_global ["_tcl"], "__boolean"') + pir.emit(' .local pmc toBoolean') + pir.emit(' toBoolean = get_root_global ["_tcl"], "toBoolean"') # This node has 3 children. generate PIR so that: # if node1 then node2 else node3 @@ -435,7 +435,7 @@ pir .= $S0 cond_result = cond['ret'] - pir.emit(" %0 = __boolean(%0)", cond_result) + pir.emit(" %0 = toBoolean(%0)", cond_result) pir.emit(" unless %0 goto else_%1", cond_result, label) then = children[1] Modified: trunk/languages/tcl/tools/gen_inline.pl ============================================================================== --- trunk/languages/tcl/tools/gen_inline.pl (original) +++ trunk/languages/tcl/tools/gen_inline.pl Fri Jul 18 15:32:46 2008 @@ -36,7 +36,7 @@ our %conversions = ( # type subroutine - bool => '__boolean', + bool => 'toBoolean', channel => '__channel', expr => '__expr', int => 'toInteger',
