Make first raise argument optional
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 73c298f..dabf88e 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -40,7 +40,7 @@
 break_stmt: 'break'
 continue_stmt: 'continue'
 return_stmt: 'return' [testlist]
-raise_stmt: 'raise' test [',' test [',' test]]
+raise_stmt: 'raise' [test [',' test [',' test]]]
 import_stmt: 'import' dotted_name (',' dotted_name)* | 'from' dotted_name 'import' ('*' | NAME (',' NAME)*)
 dotted_name: NAME ('.' NAME)*
 global_stmt: 'global' NAME (',' NAME)*
diff --git a/Python/ceval.c b/Python/ceval.c
index b29b5f9..28360f4 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1090,6 +1090,7 @@
 				/* Fallthrough */
 			case 1:
 				w = POP(); /* exc */
+			case 0: /* Fallthrough */
 				why = do_raise(w, v, u);
 				break;
 			default:
@@ -1967,6 +1968,17 @@
 do_raise(type, value, tb)
 	PyObject *type, *value, *tb;
 {
+	if (type == NULL) {
+		/* Reraise */
+		PyThreadState *tstate = PyThreadState_Get();
+		type = tstate->exc_type == NULL ? Py_None : tstate->exc_type;
+		value = tstate->exc_value;
+		tb = tstate->exc_traceback;
+		Py_XINCREF(type);
+		Py_XINCREF(value);
+		Py_XINCREF(tb);
+	}
+		
 	/* We support the following forms of raise:
 	   raise <class>, <classinstance>
 	   raise <class>, <argument tuple>
diff --git a/Python/compile.c b/Python/compile.c
index b4658e4..312600d 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -659,6 +659,8 @@
 {
 	int n = PyList_Size(list);
 	int i;
+	/* XXX This is quadratic in the number of names per compilation unit.
+	   XXX Should use a dictionary. */
 	for (i = n; --i >= 0; ) {
 		PyObject *w = PyList_GetItem(list, i);
 		if (v->ob_type == w->ob_type && PyObject_Compare(v, w) == 0)
@@ -2050,12 +2052,14 @@
 	node *n;
 {
 	int i;
-	REQ(n, raise_stmt); /* 'raise' test [',' test [',' test]] */
-	com_node(c, CHILD(n, 1));
-	if (NCH(n) > 3) {
-		com_node(c, CHILD(n, 3));
-		if (NCH(n) > 5)
-			com_node(c, CHILD(n, 5));
+	REQ(n, raise_stmt); /* 'raise' [test [',' test [',' test]]] */
+	if (NCH(n) > 1) {
+		com_node(c, CHILD(n, 1));
+		if (NCH(n) > 3) {
+			com_node(c, CHILD(n, 3));
+			if (NCH(n) > 5)
+				com_node(c, CHILD(n, 5));
+		}
 	}
 	i = NCH(n)/2;
 	com_addoparg(c, RAISE_VARARGS, i);
diff --git a/Python/graminit.c b/Python/graminit.c
index ca08e00..ba9359e 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -331,8 +331,9 @@
 static arc arcs_19_0[1] = {
 	{48, 1},
 };
-static arc arcs_19_1[1] = {
+static arc arcs_19_1[2] = {
 	{21, 2},
+	{0, 1},
 };
 static arc arcs_19_2[2] = {
 	{22, 3},
@@ -353,7 +354,7 @@
 };
 static state states_19[7] = {
 	{1, arcs_19_0},
-	{1, arcs_19_1},
+	{2, arcs_19_1},
 	{2, arcs_19_2},
 	{1, arcs_19_3},
 	{2, arcs_19_4},