@@ -891,7 +891,7 @@ drop_stmt
891891 keyword: r .toLowerCase (),
892892 prefix: ife,
893893 name: t,
894- options: [{ type: ' origin' , value: op }],
894+ options: op && [{ type: ' origin' , value: op }],
895895 }
896896 };
897897 }
@@ -1203,7 +1203,8 @@ column_ref_idx_list
12031203 }
12041204
12051205cte_idx_column_definition
1206- = LPAREN __ l :column_ref_idx_list __ RPAREN {
1206+ = LPAREN __ l :(column_ref_idx_list / expr_list ) __ RPAREN {
1207+ if (l .type ) return l .value
12071208 return l
12081209 }
12091210
@@ -3247,6 +3248,7 @@ cast_expr
32473248 type: ' cast' ,
32483249 keyword: c .toLowerCase (),
32493250 expr: e,
3251+ symbol: ' as' ,
32503252 target: t
32513253 };
32523254 }
@@ -3255,6 +3257,7 @@ cast_expr
32553257 type: ' cast' ,
32563258 keyword: c .toLowerCase (),
32573259 expr: e,
3260+ symbol: ' as' ,
32583261 target: {
32593262 dataType: ' DECIMAL(' + precision + ' )'
32603263 }
@@ -3265,6 +3268,7 @@ cast_expr
32653268 type: ' cast' ,
32663269 keyword: c .toLowerCase (),
32673270 expr: e,
3271+ symbol: ' as' ,
32683272 target: {
32693273 dataType: ' DECIMAL(' + precision + ' , ' + scale + ' )'
32703274 }
@@ -3275,6 +3279,7 @@ cast_expr
32753279 type: ' cast' ,
32763280 keyword: c .toLowerCase (),
32773281 expr: e,
3282+ symbol: ' as' ,
32783283 target: {
32793284 dataType: s + (t ? ' ' + t: ' ' )
32803285 }
@@ -3933,8 +3938,8 @@ binary_type
39333938
39343939
39353940character_string_type
3936- = t :(KW_CHAR / KW_VARCHAR ) __ LPAREN __ l :[0-9]+ __ RPAREN {
3937- return { dataType: t, length: parseInt (l .join (' ' ), 10 ), parentheses: true };
3941+ = t :(KW_CHAR / KW_VARCHAR ) __ LPAREN __ l :[0-9]+ __ RPAREN __ s :( 'ARRAY' i ) ? {
3942+ return { dataType: t, length: parseInt (l .join (' ' ), 10 ), parentheses: true , suffix : s && [ ' ARRAY ' ] };
39383943 }
39393944 / t :KW_CHAR { return { dataType: t }; }
39403945 / t :KW_VARCHAR { return { dataType: t }; }
0 commit comments