Overview
| Artifact ID: | 55fc070f9ef053f1d2285dd6ca43cb666fb1c616 |
|---|---|
| Ticket: | 644819ffffffffffffffffffffffffffffffffff
Bytecompiled [switch] Command |
| User & Date: | dkf on 2002-12-12 22:16:13 |
Changes
- icomment:
Logged In: YES user_id=79902 Writing a piece of code to bytecode compile a command, and especially one that has sub-scripts like [if], [for], [while] and [switch] is really much harder than it looks. There's a lot of undocumented assumptions out there. (I think that it should be easier to generate bytecode for commands that don't have such things. Almost straight forward once you understand what's going on with jump fixups, stack depths and the bytecode models themselves.) About the specific points you raise: I think we should have split the 8.4.1 branch off immediately after the 8.4.0 release. :^) The comment refers to the fact that we don't care if the switch was called switch, or "switch" or {switch} or whatever; if we get to this code, we assume we know that we're at the right spot. And that comment only refers to the next line. The ones after that check that we've got options that we understand; not all of them are like that, and there's not a lot of point in trying to compile switches with -regexp as there's no neat way to generate bytecode for them right now (I'd need to add bytecodes too, an INST_RE_MATCH if nothing else.) I just handle the cases where we might get a real benefit. The other comment that you pick out relates to the fact that we are in the middle of handling a {key body key body ...} construct, and that is really difficult to do because you can't operate on a copy of the source (a fact which cost me about a day's solid work to discover and fix!) - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"