Skip to content

Commit

Permalink
Unary works, and updated some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Nov 11, 2013
1 parent e090bd2 commit 0fc7726
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
1 change: 0 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/sh
echo "This is just autoreconf..."
autoreconf -i
2 changes: 1 addition & 1 deletion src/components/compiler/saffire.l
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@


/* Our actual lexemes */
lnum [0-9]+
lnum -?[0-9]+
/* identifier (::[\+])|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*[\?\!]?) */
identifier (::[\+])|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)
whitespace [ \t\r]+
Expand Down
35 changes: 17 additions & 18 deletions unittests/tests/syntax/switch-001.sfu
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,34 @@ switch (1) {
}
====
@@@@
!skip
switch (a) {
switch ("foo") {
case "foo" :
case "bar" :
}

====

@@@@
!skip
switch (a) {
switch ("bar") {
case "foo" :
}

====

@@@@
!skip
switch (a) {
import io;
a = b = 1;
switch (true) {
case a == 1 :
case b == 1 :
io.print("a");
case b == 2 :
io.print("b");
break;
default :
a = 1;
break;
}

====
ab
@@@@
switch (a) {
break;
Expand All @@ -82,8 +84,7 @@ switch (a) {
====
Error in line 3: syntax error, unexpected break, expecting case or default
@@@@
!skip
switch (a) {
switch (1) {
case 1:
a = 1;
break;
Expand All @@ -94,8 +95,7 @@ switch (a) {

====
@@@@
!skip
switch (a) {
switch (1) {
case 1:
a = 1;
break;
Expand Down Expand Up @@ -130,15 +130,14 @@ switch (a) {
====
default label already supplied
@@@@
!skip
switch (a) {
case False:
switch (false) {
case false:
a = 1;
break;
case True:
case true:
a = 1;
break;
case Null:
case null:
a = 1;
break;
}
Expand Down
1 change: 0 additions & 1 deletion unittests/tests/syntax/switch-002.sfu
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,4 @@ switch (foo) {
}
====
fd
@@@@

0 comments on commit 0fc7726

Please sign in to comment.