Skip to content

Commit

Permalink
fix case of default with no break
Browse files Browse the repository at this point in the history
--HG--
branch : com.mozilla.es4.smlnj
extra : convert_revision : 334cbfd1ef4e692e4e202d74db47008b6c8a0e83
  • Loading branch information
jeffdyer committed Sep 3, 2007
1 parent f42cce7 commit c79ab6d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 26 deletions.
40 changes: 20 additions & 20 deletions comp-esc1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@
#./esc1.sh tests/self/util-tamarin.es
#./esc1.sh tests/self/tamarin-esc1.es

#./esc.sh tests/self/debug.es
./esc.sh tests/self/util.es
#./esc.sh tests/self/ast.es
#./esc.sh tests/self/lex-char.es
#./esc.sh tests/self/lex-token.es
#./esc.sh tests/self/lex-scan.es
./esc.sh tests/self/parse-util.es
#./esc.sh tests/self/parse-ident.es
./esc.sh tests/self/parse-lhsexpr.es
./esc.sh tests/self/parse-assignexpr.es
./esc.sh tests/self/parse-ptrn.es
./esc.sh tests/self/parse-type.es
./esc.sh tests/self/parse-stmt.es
./esc.sh tests/self/parse-defn.es
./esc.sh tests/self/parse-prgm.es
#./esc.sh tests/self/decoder.es
#./esc.sh tests/self/encoder.es
#./esc.sh tests/self/util-tamarin.es
#./esc.sh tests/self/tamarin-esc1.es
#./esc3.sh tests/self/debug.es
#./esc3.sh tests/self/util.es
#./esc3.sh tests/self/ast.es
#./esc3.sh tests/self/lex-char.es
#./esc3.sh tests/self/lex-token.es
#./esc3.sh tests/self/lex-scan.es
#./esc3.sh tests/self/parse-util.es
#./esc3.sh tests/self/parse-ident.es
#./esc3.sh tests/self/parse-lhsexpr.es
#./esc3.sh tests/self/parse-assignexpr.es
#./esc3.sh tests/self/parse-ptrn.es
#./esc3.sh tests/self/parse-type.es
#./esc3.sh tests/self/parse-stmt.es
#./esc3.sh tests/self/parse-defn.es
#./esc3.sh tests/self/parse-prgm.es
#./esc3.sh tests/self/decoder.es
#./esc3.sh tests/self/encoder.es
#./esc3.sh tests/self/util-tamarin.es
#./esc3.sh tests/self/tamarin-esc1.es

/work/tamarin/bin/shell -Dinterp tests/self/debug.es.abc tests/self/ast.es.abc tests/self/util.es.abc tests/self/lex-char.es.abc tests/self/lex-token.es.abc tests/self/lex-scan.es.abc tests/self/parse-util.es.abc tests/self/parse-ident.es.abc tests/self/parse-lhsexpr.es.abc tests/self/parse-assignexpr.es.abc tests/self/parse-ptrn.es.abc tests/self/parse-type.es.abc tests/self/parse-stmt.es.abc tests/self/parse-defn.es.abc tests/self/parse-prgm.es.abc tests/self/util-tamarin.es.abc tests/self/decoder.es.abc tests/self/encoder.es.abc tests/self/tamarin-esc1.es.abc -- $1
/work/tamarin/bin/shell -Dinterp -Dverbose tests/self/debug.es.abc tests/self/ast.es.abc tests/self/util.es.abc tests/self/lex-char.es.abc tests/self/lex-token.es.abc tests/self/lex-scan.es.abc tests/self/parse-util.es.abc tests/self/parse-ident.es.abc tests/self/parse-lhsexpr.es.abc tests/self/parse-assignexpr.es.abc tests/self/parse-ptrn.es.abc tests/self/parse-type.es.abc tests/self/parse-stmt.es.abc tests/self/parse-defn.es.abc tests/self/parse-prgm.es.abc tests/self/util-tamarin.es.abc tests/self/decoder.es.abc tests/self/encoder.es.abc tests/self/tamarin-esc1.es.abc -- $1

#zip abc tests/self/debug.es.abc tests/self/lex-char.es.abc tests/self/lex-token.es.abc tests/self/lex-scan.es.abc tests/self/parse-util.es.abc tests/self/parse-ident.es.abc tests/self/parse-expr.es.abc tests/self/parse-ptrn.es.abc tests/self/parse-type.es.abc tests/self/parse-stmt.es.abc tests/self/parse-defn.es.abc tests/self/parse-prgm.es.abc tests/self/util-tamarin.es.abc tests/self/esc1.es.abc tests/self/debug.es.ast tests/self/lex-char.es.ast tests/self/lex-token.es.ast tests/self/lex-scan.es.ast tests/self/parse-util.es.ast tests/self/parse-ident.es.ast tests/self/parse-expr.es.ast tests/self/parse-ptrn.es.ast tests/self/parse-type.es.ast tests/self/parse-stmt.es.ast tests/self/parse-defn.es.ast tests/self/parse-prgm.es.ast tests/self/util-tamarin.es.ast tests/self/esc1.es.ast tests/self/debug.es tests/self/lex-char.es tests/self/lex-token.es tests/self/lex-scan.es tests/self/parse-util.es tests/self/parse-ident.es tests/self/parse-expr.es tests/self/parse-ptrn.es tests/self/parse-type.es tests/self/parse-stmt.es tests/self/parse-defn.es tests/self/parse-prgm.es tests/self/util-tamarin.es tests/self/esc1.es
12 changes: 6 additions & 6 deletions tests/self/cogen-stmt.es
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,17 @@
let c = cases[i];

if (c.expr == null) {
assert (Ldefault===null);
assert (Ldefault==null);
Ldefault = asm.I_label(); // label default pos
}

if (Lnext !== null) {
asm.I_label(Lnext); // label next pos
asm.I_label(Lnext); // label next pos
Lnext = null;
}

if (c.expr != null) {
cgExpr(nctx, c.expr); // check for match
cgExpr(nctx, c.expr); // check for match
asm.I_getlocal(t);
asm.I_strictequals();
Lnext = asm.I_iffalse(); // if no match jump to next label
Expand All @@ -254,14 +254,14 @@
cgStmt(nctx, stmts[j] );
}

Lfall = asm.I_jump (); // fall through
Lfall = asm.I_jump (); // fall through
}
if (Lnext !== null)
asm.I_label(Lnext);
if (Lfall !== null)
asm.I_label(Lfall);
if (Ldefault !== null)
asm.I_jump(Ldefault);
if (Lfall !== null)
asm.I_label(Lfall);
asm.I_label(Lbreak);
asm.killTemp(t);
}
Expand Down
15 changes: 15 additions & 0 deletions tests/self/t.es
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
/*
switch (false) {
default:
print(false)
case true:
print (true)
}
switch (false) {
case true:
print(true);
default:
print(false);
}
*/
print ('hi')

0 comments on commit c79ab6d

Please sign in to comment.