Skip to content
Browse files

Unary works, and updated some tests

  • Loading branch information...
1 parent e090bd2 commit 0fc77266d8bc6991bfb5edd71fd42419059c1425 @jaytaph jaytaph committed Nov 11, 2013
Showing with 18 additions and 21 deletions.
  1. +0 −1 autogen.sh
  2. +1 −1 src/components/compiler/saffire.l
  3. +17 −18 unittests/tests/syntax/switch-001.sfu
  4. +0 −1 unittests/tests/syntax/switch-002.sfu
View
1 autogen.sh
@@ -1,3 +1,2 @@
#!/bin/sh
-echo "This is just autoreconf..."
autoreconf -i
View
2 src/components/compiler/saffire.l
@@ -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]+
View
35 unittests/tests/syntax/switch-001.sfu
@@ -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;
@@ -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;
@@ -94,8 +95,7 @@ switch (a) {
====
@@@@
-!skip
-switch (a) {
+switch (1) {
case 1:
a = 1;
break;
@@ -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;
}
View
1 unittests/tests/syntax/switch-002.sfu
@@ -210,5 +210,4 @@ switch (foo) {
}
====
fd
-@@@@

0 comments on commit 0fc7726

Please sign in to comment.
Something went wrong with that request. Please try again.