diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-29 13:59:32 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-29 13:59:32 (GMT) |
commit | 6597355ad8e93ef19d16f6fea501506b141946fb (patch) | |
tree | 2091eb2c45df9f3cf0d55b3f84cabe501772869d /generic/tclExecute.c | |
parent | f4549b8fc40b29db66113e7a63678f2f0c45db78 (diff) | |
download | tcl-6597355ad8e93ef19d16f6fea501506b141946fb.zip tcl-6597355ad8e93ef19d16f6fea501506b141946fb.tar.gz tcl-6597355ad8e93ef19d16f6fea501506b141946fb.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.c | 19 |
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: |