3 source/parse.y | 43 +++++++++++++++++++++++++++++++++++--------
4 1 file changed, 35 insertions(+), 8 deletions(-)
6 diff --quilt old/source/parse.y new/source/parse.y
9 @@ -421,27 +421,54 @@ 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.
14 - Inst *this = GetPC();
16 + /* start case and skip this index */
22 /* add code to push the rvalue expression value */
23 ADD_OP(OP_PUSH_IMMED); ADD_IMMED($$);
24 ADD_OP(OP_ARRAY_REF); ADD_IMMED(1);
25 /* swap this code in front of the lvalue assignment code */
26 - SwapCode($1, this, GetPC());
27 + SwapCode($1, $2, GetPC());
29 + | lventry mark lvselector {
30 + /* don't advance index */
32 + /* swap this code in front of the lvalue assignment code */
33 + SwapCode($1, $2, GetPC());
35 - | lvlist ',' blank lventry {
36 - Inst *this = GetPC();
37 + | lvlist ',' blank {
38 + /* skip this index */
41 + | lvlist ',' blank lventry mark {
42 /* the index for this entry into the rvalue array */
44 /* add code to push the rvalue expression value */
45 ADD_OP(OP_PUSH_IMMED); ADD_IMMED($$);
46 ADD_OP(OP_ARRAY_REF); ADD_IMMED(1);
47 /* swap this code in front of the lvalue assignment code */
48 - SwapCode($4, this, GetPC());
51 + SwapCode($4, $5, GetPC());
53 + | lvlist ',' blank lventry mark lvselector {
54 + /* don't advance index */
56 + /* swap this code in front of the lvalue assignment code */
57 + SwapCode($4, $5, GetPC());
60 +lvselector: blank '=' blank '[' arglist ']' {
61 + /* add code to push the rvalue expression value */
62 + ADD_OP(OP_ARRAY_REF); ADD_IMMED($5);
64 + | blank '=' blank dot field {
65 + /* add code to push the rvalue expression value */
66 + ADD_OP(OP_ARRAY_REF); ADD_IMMED(1);
69 /* lventry's value is the start of the assignment code */
71 /* the rvalue is right on top, just dup it */