summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-01-29 13:59:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-01-29 13:59:32 (GMT)
commit60e360f12b1c25a8e89f5893a564ca17d3b99217 (patch)
tree2091eb2c45df9f3cf0d55b3f84cabe501772869d /generic/tclExecute.c
parent18cc046d76f822340ac711ab379965ea61cae9b3 (diff)
downloadtcl-60e360f12b1c25a8e89f5893a564ca17d3b99217.zip
tcl-60e360f12b1c25a8e89f5893a564ca17d3b99217.tar.gz
tcl-60e360f12b1c25a8e89f5893a564ca17d3b99217.tar.bz2
Compile [string is] with character classes in a non-awful way. Needs more work to make resulting bytecode disassemble nicely.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 916de17..58d85e1 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: