summaryrefslogtreecommitdiffstats
path: root/Python/graminit.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-25 21:02:56 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-25 21:02:56 (GMT)
commit944f684ce6f439bc868d4b189c45f726dfb9d3b1 (patch)
tree3fd9c596e78b01836158508978ce8eab678bb37b /Python/graminit.c
parent04516611e7e4ceaef6fef9413719e9cb5b4bb087 (diff)
downloadcpython-944f684ce6f439bc868d4b189c45f726dfb9d3b1.zip
cpython-944f684ce6f439bc868d4b189c45f726dfb9d3b1.tar.gz
cpython-944f684ce6f439bc868d4b189c45f726dfb9d3b1.tar.bz2
Allow multiple context managers in one with statement, as proposed
in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
Diffstat (limited to 'Python/graminit.c')
-rw-r--r--Python/graminit.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/Python/graminit.c b/Python/graminit.c
index ec2f421..2e3e9e8 100644
--- a/Python/graminit.c
+++ b/Python/graminit.c
@@ -901,42 +901,43 @@ static arc arcs_41_0[1] = {
{100, 1},
};
static arc arcs_41_1[1] = {
- {28, 2},
+ {101, 2},
};
static arc arcs_41_2[2] = {
- {101, 3},
- {23, 4},
+ {29, 1},
+ {23, 3},
};
static arc arcs_41_3[1] = {
- {23, 4},
+ {24, 4},
};
static arc arcs_41_4[1] = {
- {24, 5},
-};
-static arc arcs_41_5[1] = {
- {0, 5},
+ {0, 4},
};
-static state states_41[6] = {
+static state states_41[5] = {
{1, arcs_41_0},
{1, arcs_41_1},
{2, arcs_41_2},
{1, arcs_41_3},
{1, arcs_41_4},
- {1, arcs_41_5},
};
static arc arcs_42_0[1] = {
- {80, 1},
+ {28, 1},
};
-static arc arcs_42_1[1] = {
- {84, 2},
+static arc arcs_42_1[2] = {
+ {80, 2},
+ {0, 1},
};
static arc arcs_42_2[1] = {
- {0, 2},
+ {84, 3},
+};
+static arc arcs_42_3[1] = {
+ {0, 3},
};
-static state states_42[3] = {
+static state states_42[4] = {
{1, arcs_42_0},
- {1, arcs_42_1},
+ {2, arcs_42_1},
{1, arcs_42_2},
+ {1, arcs_42_3},
};
static arc arcs_43_0[1] = {
{102, 1},
@@ -1877,10 +1878,10 @@ static dfa dfas[85] = {
"\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"},
{296, "try_stmt", 0, 13, states_40,
"\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"},
- {297, "with_stmt", 0, 6, states_41,
+ {297, "with_stmt", 0, 5, states_41,
"\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"},
- {298, "with_var", 0, 3, states_42,
- "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000"},
+ {298, "with_item", 0, 4, states_42,
+ "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"},
{299, "except_clause", 0, 5, states_43,
"\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"},
{300, "suite", 0, 5, states_44,