re-fresh
[nedit-bw.git] / MultipleAssignment-selector.patch
blob19d69920e465bf00e7091f7023c007d1ae6368fb
1 ---
3 source/parse.y | 31 ++++++++++++++++++++++++++++++-
4 1 file changed, 30 insertions(+), 1 deletion(-)
6 diff --quilt old/source/parse.y new/source/parse.y
7 --- old/source/parse.y
8 +++ new/source/parse.y
9 @@ -430,7 +430,11 @@ lvlistexpr: '(' mark lvlist mark ')' bla
10 ** the lvalue, so that the result is ontop od the stack.
11 ** lventry's value will give us the start of this code.
13 -lvlist: lventry mark {
14 +lvlist: blank {
15 + /* start case and skip this index */
16 + $$ = 1;
17 + }
18 + | lventry mark {
19 /* start case */
20 $$ = 1;
21 /* add code to push the rvalue expression value */
22 @@ -439,6 +443,16 @@ lvlist: lventry m
23 /* swap this code in front of the lvalue assignment code */
24 SwapCode($1, $2, GetPC());
26 + | lventry mark lvselector {
27 + /* don't advance index */
28 + $$ = 0;
29 + /* swap this code in front of the lvalue assignment code */
30 + SwapCode($1, $2, GetPC());
31 + }
32 + | lvlist ',' blank {
33 + /* skip this index */
34 + $$ = $1 + 1;
35 + }
36 | lvlist ',' blank lventry mark {
37 /* the index for this entry into the rvalue array */
38 $$ = $1 + 1;
39 @@ -448,6 +462,21 @@ lvlist: lventry m
40 /* swap this code in front of the lvalue assignment code */
41 SwapCode($4, $5, GetPC());
43 + | lvlist ',' blank lventry mark lvselector {
44 + /* don't advance index */
45 + $$ = $1 + 0;
46 + /* swap this code in front of the lvalue assignment code */
47 + SwapCode($4, $5, GetPC());
48 + }
49 + ;
50 +lvselector: blank '=' blank '[' arglist ']' {
51 + /* add code to push the rvalue expression value */
52 + ADD_OP(OP_ARRAY_REF); ADD_IMMED($5);
53 + }
54 + | blank '=' blank dot field {
55 + /* add code to push the rvalue expression value */
56 + ADD_OP(OP_ARRAY_REF); ADD_IMMED(1);
57 + }
59 /* lventry's value is the start of the assignment code */
60 lventry: SYMBOL {