From 3b5bfd6c4c47250eeaaa96ce4f552822e11739d1 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 14 Mar 2015 11:52:15 +0100 Subject: [PATCH] Fix bad nesting of and
, other minor changes. --- index.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 3c4cefa..23d267b 100644 --- a/index.html +++ b/index.html @@ -204,10 +204,8 @@ llOwnerSay("Program version " STRINGIFY(VERSION)

The syntax of the switch statement as implemented, has two restrictions over its C counterpart:

    -
  1. -case labels can't appear in nested blocks. That's because they are replaced by LSL labels, and as discussed in the Multiple labels with the same name section above, label scope rules prevent their visibility in an outer block, so once converted to labels, the corresponding jump instructions would not be able to find them. This limitation means that Duff's device or similar constructs can't be implemented with this optimizer.
  2. -
  3. -
    switch() needs to be followed by a block, not by a single statement. For example, whiile this works in C, it won't work in this optimizer:
    +
  4. case labels can't appear in nested blocks. That's because they are replaced by LSL labels, and as discussed in the Multiple labels with the same name section above, label scope rules prevent their visibility in an outer block, so once converted to labels, the corresponding jump instructions would not be able to find them. This limitation means that Duff's device or similar constructs can't be implemented with this optimizer.
  5. +
  6. switch() needs to be followed by a block, not by a single statement. For example, whiile this works in C, it won't work in this optimizer:
        switch(1) case 1: break;
    The reason is that case is treated by this parser as a statement, rather than as a label prefix, making break be outside the switch. This limitation is probably only of theoretical importance and will not have any practical implication, since single-statement switch clauses are of little no practical use (known to the author). Of course it works perfectly when enclosed in braces:
        switch(1) { case 1: break; }