Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited6d8ff

Browse files
author
Aleksandr Parfenov
committed
Fix gram to support complex expressions without parentheses
1 parent02b3890 commited6d8ff

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

‎src/backend/parser/gram.y

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
587587
%type<ival>dictionary_map_set_expr_operator
588588
%type<dmapelem>dictionary_map_dictdictionary_map_command_expr_paren
589589
dictionary_map_set_exprdictionary_map_case
590-
dictionary_map_actiondictionary_map
591-
opt_dictionary_map_case_elsedictionary_config
592-
dictionary_config_comma
590+
dictionary_map_actionopt_dictionary_map_case_else
591+
dictionary_configdictionary_config_comma
593592

594593
/*
595594
* Non-keyword token types. These are hard-wired into the "flex" lexer.
@@ -10449,7 +10448,7 @@ dictionary_config_comma:
1044910448
;
1045010449

1045110450
dictionary_config:
10452-
dictionary_map {$$ =$1; }
10451+
dictionary_map_set_expr {$$ =$1; }
1045310452
|dictionary_map_dict','dictionary_config_comma
1045410453
{
1045510454
DictMapExprElem *n = makeNode(DictMapExprElem);
@@ -10465,11 +10464,6 @@ dictionary_config:
1046510464
}
1046610465
;
1046710466

10468-
dictionary_map:
10469-
dictionary_map_case {$$ =$1; }
10470-
|dictionary_map_set_expr {$$ =$1; }
10471-
;
10472-
1047310467
dictionary_map_action:
1047410468
KEEP
1047510469
{
@@ -10478,16 +10472,16 @@ dictionary_map_action:
1047810472
n->data =NULL;
1047910473
$$ = n;
1048010474
}
10481-
|dictionary_map {$$ =$1; }
10475+
|dictionary_map_set_expr {$$ =$1; }
1048210476
;
1048310477

1048410478
opt_dictionary_map_case_else:
10485-
ELSEdictionary_map {$$ =$2; }
10479+
ELSEdictionary_map_set_expr {$$ =$2; }
1048610480
| {$$ =NULL; }
1048710481
;
1048810482

1048910483
dictionary_map_case:
10490-
CASEdictionary_mapWHENopt_dictionary_map_noMATCHTHENdictionary_map_actionopt_dictionary_map_case_elseEND_P
10484+
CASEdictionary_map_set_exprWHENopt_dictionary_map_noMATCHTHENdictionary_map_actionopt_dictionary_map_case_elseEND_P
1049110485
{
1049210486
DictMapCase *n = makeNode(DictMapCase);
1049310487
DictMapElem *r = makeNode(DictMapElem);
@@ -10512,20 +10506,7 @@ dictionary_map_set_expr_operator:
1051210506

1051310507
dictionary_map_set_expr:
1051410508
dictionary_map_command_expr_paren {$$ =$1; }
10515-
|dictionary_map_casedictionary_map_set_expr_operatordictionary_map_case
10516-
{
10517-
DictMapExprElem *n = makeNode(DictMapExprElem);
10518-
DictMapElem *r = makeNode(DictMapElem);
10519-
10520-
n->left =$1;
10521-
n->oper =$2;
10522-
n->right =$3;
10523-
10524-
r->kind = DICT_MAP_EXPRESSION;
10525-
r->data = n;
10526-
$$ = r;
10527-
}
10528-
|dictionary_map_command_expr_parendictionary_map_set_expr_operatordictionary_map_command_expr_paren
10509+
|dictionary_map_set_exprdictionary_map_set_expr_operatordictionary_map_command_expr_paren
1052910510
{
1053010511
DictMapExprElem *n = makeNode(DictMapExprElem);
1053110512
DictMapElem *r = makeNode(DictMapElem);
@@ -10543,6 +10524,7 @@ dictionary_map_set_expr:
1054310524
dictionary_map_command_expr_paren:
1054410525
'('dictionary_map_set_expr')'{$$ =$2; }
1054510526
|dictionary_map_dict{$$ =$1; }
10527+
|dictionary_map_case{$$ =$1; }
1054610528
;
1054710529

1054810530
dictionary_map_dict:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp