Author: mdiep Date: Tue Aug 9 15:13:35 2005 New Revision: 8898 Modified: trunk/languages/tcl/lib/commands/for.pir trunk/languages/tcl/lib/commands/if.pir trunk/languages/tcl/lib/commands/while.pir trunk/languages/tcl/lib/expression.pir Log: tcl: Always use a string when calling __expression_parse
Modified: trunk/languages/tcl/lib/commands/for.pir ============================================================================== --- trunk/languages/tcl/lib/commands/for.pir (original) +++ trunk/languages/tcl/lib/commands/for.pir Tue Aug 9 15:13:35 2005 @@ -56,7 +56,8 @@ continue: #print "\n" #print "FOR_CONTINUE2:\n" # then check condition - (return_type,test_parsed) = expression_p(test_p) + $S0 = test_p + (return_type,test_parsed) = expression_p($S0) #print "RETURN_TYPE =" #print return_type #print "\n" Modified: trunk/languages/tcl/lib/commands/if.pir ============================================================================== --- trunk/languages/tcl/lib/commands/if.pir (original) +++ trunk/languages/tcl/lib/commands/if.pir Tue Aug 9 15:13:35 2005 @@ -16,7 +16,7 @@ elseifs = new TclList .local pmc retval,condition .local string code - .local pmc condition + .local string condition .local string body .local string else .local int return_type Modified: trunk/languages/tcl/lib/commands/while.pir ============================================================================== --- trunk/languages/tcl/lib/commands/while.pir (original) +++ trunk/languages/tcl/lib/commands/while.pir Tue Aug 9 15:13:35 2005 @@ -27,7 +27,8 @@ register parsed_code while_loop: - (return_type,retval) = expression_p(cond_p) + $S0 = cond_p + (return_type,retval) = expression_p($S0) if return_type == TCL_ERROR goto done_done (return_type,retval) = expression_i(retval) if return_type == TCL_ERROR goto done_done Modified: trunk/languages/tcl/lib/expression.pir ============================================================================== --- trunk/languages/tcl/lib/expression.pir (original) +++ trunk/languages/tcl/lib/expression.pir Tue Aug 9 15:13:35 2005 @@ -17,8 +17,9 @@ however, then we're returning the invoka .const int MAX_PRECEDENCE = 9 .sub __expression_parse - - .local string expr # String containing our expression + .param string expr + .param pmc foo + .local int return_type # TCL return code return_type = TCL_OK .local pmc retval # TCL return value @@ -28,17 +29,6 @@ however, then we're returning the invoka .local pmc precedences # Global list of operator precedence precedences = find_global "_Tcl", "precedence" - if I3 == 1 goto pmc_arg - # if I2 isn't one here, we should blow up. But who's counting. - expr = S5 - goto got_arg - -pmc_arg: - expr = P5 - #print "GOT AN EXPR OF:" - #print expr - #print "\n" - got_arg: .local pmc undef undef = new Undef @@ -111,10 +101,8 @@ get_paren_done: inc chunk_start substr $S1, expr, chunk_start, $I0 - $P9 = new String - $P9 = $S1 # XXX this is now officially braindead. Fissit. - (return_type,retval) = __expression_parse($P9) + (return_type,retval) = __expression_parse($S1) if return_type == TCL_ERROR goto die_horribly (return_type,retval) = __expression_interpret(retval) if return_type == TCL_ERROR goto die_horribly @@ -928,10 +916,8 @@ loop_done: len_operand = $I1 substr $S1, expr, start_paren_pos, len_operand - $P9 = new String - $P9 = $S1 # XXX should be checking return value here. - ($I9,operand) = __expression_parse($P9) + ($I9,operand) = __expression_parse($S1) ($I9,operand) = __expression_interpret(operand) $P10 = new FixedPMCArray $P10 = 2
