@@ -2863,8 +2863,14 @@ array_index
28632863 }
28642864 }
28652865
2866+ array_index_list
2867+ = head :array_index tail :(__ array_index )* {
2868+ // => array_index[]
2869+ return createList (head, tail, 1 )
2870+ }
2871+
28662872expr_item
2867- = e :binary_column_expr __ a :array_index ? {
2873+ = e :binary_column_expr __ a :array_index_list ? {
28682874 // => binary_expr & { array_index: array_index }
28692875 if (a) e .array_index = a
28702876 return e
@@ -3371,7 +3377,7 @@ update_stmt
33713377 const table = queryTableAlias (col .table )
33723378 tableList .add (` update::${ dbObj[table] || null } ::${ table} ` )
33733379 }
3374- columnList .add (` update::${ col .table } ::${ col .column } ` )
3380+ columnList .add (` update::${ col .table } ::${ col .column . expr . value } ` )
33753381 });
33763382 }
33773383 return {
@@ -3444,13 +3450,13 @@ set_list
34443450 * 'col1 = (col2 > 3)'
34453451 */
34463452set_item
3447- = tbl :( ident __ DOT ) ? __ c : column_without_kw_type __ '=' __ v :additive_expr {
3448- // => { column: ident; value: additive_expr; table?: ident;}
3449- return { column : { expr : c } , value: v, table : tbl && tbl[ 0 ] };
3450- }
3451- / tbl :( ident __ DOT ) ? __ c : column_without_kw_type __ '=' __ KW_VALUES __ LPAREN __ v :column_ref __ RPAREN {
3452- // => { column: ident; value: column_ref; table?: ident; keyword: 'values' }
3453- return { column : { expr : c } , value: v, table : tbl && tbl[ 0 ] , keyword: ' values' };
3453+ = c : column_ref_array_index __ '=' __ v :additive_expr {
3454+ // => { column: ident; value: additive_expr; table?: ident;}
3455+ return { ... c , value: v };
3456+ }
3457+ / column_ref_array_index __ '=' __ KW_VALUES __ LPAREN __ v :column_ref __ RPAREN {
3458+ // => { column: ident; value: column_ref; table?: ident; keyword: 'values' }
3459+ return { ... c , value: v, keyword: ' values' };
34543460 }
34553461
34563462returning_stmt
@@ -3983,7 +3989,7 @@ multiplicative_operator
39833989 = "*" / "/" / "%" / "||"
39843990
39853991column_ref_array_index
3986- = c :column_ref __ a :array_index ? {
3992+ = c :column_ref __ a :array_index_list ? {
39873993 // => column_ref
39883994 if (a) c .array_index = a
39893995 return c
0 commit comments