diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-03 09:53:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-02-03 09:53:42 (GMT) |
commit | 5b741f3b8fcdc21ce6f1d0410bf7308c5207ada2 (patch) | |
tree | 244693174d38e028c0274b473120b1d4c3f27d93 /generic/tclExecute.c | |
parent | ce4fe3ed28878c07914ca81152776b3d69b2fe2e (diff) | |
parent | 6376a7f056624dfca2cce996a6ffc44cf931fe45 (diff) | |
download | tcl-5b741f3b8fcdc21ce6f1d0410bf7308c5207ada2.zip tcl-5b741f3b8fcdc21ce6f1d0410bf7308c5207ada2.tar.gz tcl-5b741f3b8fcdc21ce6f1d0410bf7308c5207ada2.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a5e6d9b..98dc522 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5678,6 +5678,25 @@ TEBCresume( TclNewLongObj(objResultPtr, match); NEXT_INST_F(1, 2, 1); + + case INST_STR_CLASS: + opnd = TclGetInt1AtPtr(pc+1); + valuePtr = OBJ_AT_TOS; + TRACE(("%s \"%.30s\" => ", tclStringClassTable[opnd].name, + O2S(valuePtr))); + ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length); + match = 1; + if (length > 0) { + end = ustring1 + length; + for (p=ustring1 ; p<end ; p++) { + if (!tclStringClassTable[opnd].comparator(*p)) { + match = 0; + break; + } + } + } + TRACE_APPEND(("%d\n", match)); + JUMP_PEEPHOLE_F(match, 2, 1); } case INST_STR_MATCH: @@ -5812,6 +5831,14 @@ TEBCresume( int type1, type2; long l1, l2, lResult; + case INST_NUM_TYPE: + if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) { + type1 = 0; + } + TclNewIntObj(objResultPtr, type1); + TRACE(("\"%.20s\" => %d\n", O2S(OBJ_AT_TOS), type1)); + NEXT_INST_F(1, 1, 1); + case INST_EQ: case INST_NEQ: case INST_LT: @@ -6479,6 +6506,17 @@ TEBCresume( * ----------------------------------------------------------------- */ + case INST_TRY_CVT_TO_BOOLEAN: + valuePtr = OBJ_AT_TOS; + if (valuePtr->typePtr == &tclBooleanType) { + objResultPtr = TCONST(1); + } else { + int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK); + objResultPtr = TCONST(result); + } + TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr); + NEXT_INST_F(1, 0, 1); + case INST_BREAK: /* DECACHE_STACK_INFO(); |