summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-02-02 16:01:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-02-02 16:01:21 (GMT)
commit6376a7f056624dfca2cce996a6ffc44cf931fe45 (patch)
tree3f87a56a73d52bfcc21f03f1894519de5ba04799 /generic/tclExecute.c
parenteda259d471f64cbaaad3d7cf2dd4da598deaaf37 (diff)
parent89b7e244580eb2f40d062a73485bff16682d8027 (diff)
downloadtcl-6376a7f056624dfca2cce996a6ffc44cf931fe45.zip
tcl-6376a7f056624dfca2cce996a6ffc44cf931fe45.tar.gz
tcl-6376a7f056624dfca2cce996a6ffc44cf931fe45.tar.bz2
add compilation of [string is]
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index e8bc903..ac78370 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5810,6 +5810,25 @@ TEBCresume(
TclNewIntObj(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:
@@ -5944,6 +5963,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:
@@ -6621,6 +6648,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();