mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
slightly modified version of Greg Ewing's extended call syntax patch
executive summary:
Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'.
Some file-by-file details follow.
Grammar/Grammar:
simplify varargslist, replacing '*' '*' with '**'
add * & ** options to arglist
Include/opcode.h & Lib/dis.py:
define three new opcodes
CALL_FUNCTION_VAR
CALL_FUNCTION_KW
CALL_FUNCTION_VAR_KW
Python/ceval.c:
extend TypeError "keyword parameter redefined" message to include
the name of the offending keyword
reindent CALL_FUNCTION using four spaces
add handling of sequences and dictionaries using extend calls
fix function import_from to use PyErr_Format
This commit is contained in:
parent
93a7c0fe6b
commit
7690151c7e
7 changed files with 241 additions and 148 deletions
|
|
@ -98,9 +98,8 @@ static arc arcs_5_1[3] = {
|
|||
{22, 5},
|
||||
{0, 1},
|
||||
};
|
||||
static arc arcs_5_2[2] = {
|
||||
static arc arcs_5_2[1] = {
|
||||
{12, 6},
|
||||
{23, 3},
|
||||
};
|
||||
static arc arcs_5_3[1] = {
|
||||
{12, 7},
|
||||
|
|
@ -125,25 +124,20 @@ static arc arcs_5_8[2] = {
|
|||
{22, 5},
|
||||
{0, 8},
|
||||
};
|
||||
static arc arcs_5_9[2] = {
|
||||
static arc arcs_5_9[1] = {
|
||||
{24, 3},
|
||||
{23, 10},
|
||||
};
|
||||
static arc arcs_5_10[1] = {
|
||||
{23, 3},
|
||||
};
|
||||
static state states_5[11] = {
|
||||
static state states_5[10] = {
|
||||
{3, arcs_5_0},
|
||||
{3, arcs_5_1},
|
||||
{2, arcs_5_2},
|
||||
{1, arcs_5_2},
|
||||
{1, arcs_5_3},
|
||||
{1, arcs_5_4},
|
||||
{4, arcs_5_5},
|
||||
{2, arcs_5_6},
|
||||
{1, arcs_5_7},
|
||||
{2, arcs_5_8},
|
||||
{2, arcs_5_9},
|
||||
{1, arcs_5_10},
|
||||
{1, arcs_5_9},
|
||||
};
|
||||
static arc arcs_6_0[2] = {
|
||||
{12, 1},
|
||||
|
|
@ -1169,21 +1163,46 @@ static state states_54[8] = {
|
|||
{1, arcs_54_6},
|
||||
{1, arcs_54_7},
|
||||
};
|
||||
static arc arcs_55_0[1] = {
|
||||
static arc arcs_55_0[3] = {
|
||||
{123, 1},
|
||||
{23, 2},
|
||||
{24, 3},
|
||||
};
|
||||
static arc arcs_55_1[2] = {
|
||||
{22, 2},
|
||||
{22, 4},
|
||||
{0, 1},
|
||||
};
|
||||
static arc arcs_55_2[2] = {
|
||||
{123, 1},
|
||||
{0, 2},
|
||||
static arc arcs_55_2[1] = {
|
||||
{21, 5},
|
||||
};
|
||||
static state states_55[3] = {
|
||||
{1, arcs_55_0},
|
||||
static arc arcs_55_3[1] = {
|
||||
{21, 6},
|
||||
};
|
||||
static arc arcs_55_4[4] = {
|
||||
{123, 1},
|
||||
{23, 2},
|
||||
{24, 3},
|
||||
{0, 4},
|
||||
};
|
||||
static arc arcs_55_5[2] = {
|
||||
{22, 7},
|
||||
{0, 5},
|
||||
};
|
||||
static arc arcs_55_6[1] = {
|
||||
{0, 6},
|
||||
};
|
||||
static arc arcs_55_7[1] = {
|
||||
{24, 3},
|
||||
};
|
||||
static state states_55[8] = {
|
||||
{3, arcs_55_0},
|
||||
{2, arcs_55_1},
|
||||
{2, arcs_55_2},
|
||||
{1, arcs_55_2},
|
||||
{1, arcs_55_3},
|
||||
{4, arcs_55_4},
|
||||
{2, arcs_55_5},
|
||||
{1, arcs_55_6},
|
||||
{1, arcs_55_7},
|
||||
};
|
||||
static arc arcs_56_0[1] = {
|
||||
{21, 1},
|
||||
|
|
@ -1215,7 +1234,7 @@ static dfa dfas[57] = {
|
|||
"\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000"},
|
||||
{260, "parameters", 0, 4, states_4,
|
||||
"\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
|
||||
{261, "varargslist", 0, 11, states_5,
|
||||
{261, "varargslist", 0, 10, states_5,
|
||||
"\000\020\201\001\000\000\000\000\000\000\000\000\000\000\000\000"},
|
||||
{262, "fpdef", 0, 4, states_6,
|
||||
"\000\020\001\000\000\000\000\000\000\000\000\000\000\000\000\000"},
|
||||
|
|
@ -1315,8 +1334,8 @@ static dfa dfas[57] = {
|
|||
"\000\020\001\000\000\000\000\000\000\200\000\000\060\242\074\000"},
|
||||
{310, "classdef", 0, 8, states_54,
|
||||
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"},
|
||||
{311, "arglist", 0, 3, states_55,
|
||||
"\000\020\001\000\000\000\000\000\000\200\000\000\060\242\074\000"},
|
||||
{311, "arglist", 0, 8, states_55,
|
||||
"\000\020\201\001\000\000\000\000\000\200\000\000\060\242\074\000"},
|
||||
{312, "argument", 0, 4, states_56,
|
||||
"\000\020\001\000\000\000\000\000\000\200\000\000\060\242\074\000"},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue