Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix shift/reduce conflict

  • Loading branch information...
commit 49105093587a91285ca799b4246eebc96a2fb406 1 parent 0a896f2
Hubert depesz Lubaczewski authored

Showing 3 changed files with 55 additions and 53 deletions. Show diff stats Hide diff stats

  1. +1 0  .gitignore
  2. +3 2 helper/SQL.eyp
  3. +51 51 lib/Pg/SQL/Parser/SQL.pm
1  .gitignore
@@ -13,3 +13,4 @@ MANIFEST.bak
13 13 MYMETA.*
14 14 *.backup
15 15 *.clog
  16 +helper/SQL.output
5 helper/SQL.eyp
@@ -3,9 +3,9 @@
3 3 my $factory = Pg::SQL::Parser::Element->new();
4 4 %}
5 5
6   -%left OR
  6 +/* %left OR */
7 7 %left AND
8   -%left NOT
  8 +/* %left NOT */
9 9 %right '='
10 10 %left '<' '>'
11 11 %left LIKE ILIKE
@@ -14,6 +14,7 @@
14 14 %left '+' '-'
15 15 %left '*' '/' '%'
16 16 %left '^'
  17 +%left '::'
17 18
18 19 %%
19 20
102 lib/Pg/SQL/Parser/SQL.pm
@@ -3807,42 +3807,42 @@ sub new {
3807 3807 [#Rule top_1
3808 3808 'top', 1,
3809 3809 sub {
3810   -#line 20 "SQL.eyp"
  3810 +#line 21 "SQL.eyp"
3811 3811 $_[1] }
3812 3812 #line 3812 ../lib/Pg/SQL/Parser/SQL.pm
3813 3813 ],
3814 3814 [#Rule statements_2
3815 3815 'statements', 1,
3816 3816 sub {
3817   -#line 23 "SQL.eyp"
  3817 +#line 24 "SQL.eyp"
3818 3818 [ $_[1] ] }
3819 3819 #line 3819 ../lib/Pg/SQL/Parser/SQL.pm
3820 3820 ],
3821 3821 [#Rule statements_3
3822 3822 'statements', 3,
3823 3823 sub {
3824   -#line 24 "SQL.eyp"
  3824 +#line 25 "SQL.eyp"
3825 3825 push @{ $_[1] }, $_[3]; $_[1] }
3826 3826 #line 3826 ../lib/Pg/SQL/Parser/SQL.pm
3827 3827 ],
3828 3828 [#Rule statements_4
3829 3829 'statements', 2,
3830 3830 sub {
3831   -#line 25 "SQL.eyp"
  3831 +#line 26 "SQL.eyp"
3832 3832 $_[1] }
3833 3833 #line 3833 ../lib/Pg/SQL/Parser/SQL.pm
3834 3834 ],
3835 3835 [#Rule statement_5
3836 3836 'statement', 1,
3837 3837 sub {
3838   -#line 28 "SQL.eyp"
  3838 +#line 29 "SQL.eyp"
3839 3839 $_[1] }
3840 3840 #line 3840 ../lib/Pg/SQL/Parser/SQL.pm
3841 3841 ],
3842 3842 [#Rule select_stmt_6
3843 3843 'select_stmt', 2,
3844 3844 sub {
3845   -#line 31 "SQL.eyp"
  3845 +#line 32 "SQL.eyp"
3846 3846
3847 3847 my $select = $factory->make( 'Select' );
3848 3848 for my $rc ( @{ $_[2] } ) {
@@ -3858,308 +3858,308 @@ sub {
3858 3858 [#Rule result_columns_7
3859 3859 'result_columns', 1,
3860 3860 sub {
3861   -#line 43 "SQL.eyp"
  3861 +#line 44 "SQL.eyp"
3862 3862 [ $_[1] ] }
3863 3863 #line 3863 ../lib/Pg/SQL/Parser/SQL.pm
3864 3864 ],
3865 3865 [#Rule result_columns_8
3866 3866 'result_columns', 3,
3867 3867 sub {
3868   -#line 44 "SQL.eyp"
  3868 +#line 45 "SQL.eyp"
3869 3869 push @{ $_[1] }, $_[3]; $_[1] }
3870 3870 #line 3870 ../lib/Pg/SQL/Parser/SQL.pm
3871 3871 ],
3872 3872 [#Rule result_column_9
3873 3873 'result_column', 1,
3874 3874 sub {
3875   -#line 47 "SQL.eyp"
  3875 +#line 48 "SQL.eyp"
3876 3876 [ $_[1], undef ] }
3877 3877 #line 3877 ../lib/Pg/SQL/Parser/SQL.pm
3878 3878 ],
3879 3879 [#Rule result_column_10
3880 3880 'result_column', 3,
3881 3881 sub {
3882   -#line 48 "SQL.eyp"
  3882 +#line 49 "SQL.eyp"
3883 3883 [ $_[1], $_[3] ] }
3884 3884 #line 3884 ../lib/Pg/SQL/Parser/SQL.pm
3885 3885 ],
3886 3886 [#Rule expr_11
3887 3887 'expr', 1,
3888 3888 sub {
3889   -#line 51 "SQL.eyp"
  3889 +#line 52 "SQL.eyp"
3890 3890 $_[1] }
3891 3891 #line 3891 ../lib/Pg/SQL/Parser/SQL.pm
3892 3892 ],
3893 3893 [#Rule expr_12
3894 3894 'expr', 5,
3895 3895 sub {
3896   -#line 52 "SQL.eyp"
  3896 +#line 53 "SQL.eyp"
3897 3897 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => [ $_[3], $_[5] ] ) }
3898 3898 #line 3898 ../lib/Pg/SQL/Parser/SQL.pm
3899 3899 ],
3900 3900 [#Rule expr_13
3901 3901 'expr', 2,
3902 3902 sub {
3903   -#line 53 "SQL.eyp"
  3903 +#line 54 "SQL.eyp"
3904 3904 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1] ) }
3905 3905 #line 3905 ../lib/Pg/SQL/Parser/SQL.pm
3906 3906 ],
3907 3907 [#Rule expr_14
3908 3908 'expr', 2,
3909 3909 sub {
3910   -#line 54 "SQL.eyp"
  3910 +#line 55 "SQL.eyp"
3911 3911 $factory->make( 'Operation', 'operator' => $_[1], 'right' => $_[2] ) }
3912 3912 #line 3912 ../lib/Pg/SQL/Parser/SQL.pm
3913 3913 ],
3914 3914 [#Rule expr_15
3915 3915 'expr', 3,
3916 3916 sub {
3917   -#line 55 "SQL.eyp"
  3917 +#line 56 "SQL.eyp"
3918 3918 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3919 3919 #line 3919 ../lib/Pg/SQL/Parser/SQL.pm
3920 3920 ],
3921 3921 [#Rule expr_16
3922 3922 'expr', 3,
3923 3923 sub {
3924   -#line 56 "SQL.eyp"
  3924 +#line 57 "SQL.eyp"
3925 3925 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3926 3926 #line 3926 ../lib/Pg/SQL/Parser/SQL.pm
3927 3927 ],
3928 3928 [#Rule expr_17
3929 3929 'expr', 3,
3930 3930 sub {
3931   -#line 57 "SQL.eyp"
  3931 +#line 58 "SQL.eyp"
3932 3932 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3933 3933 #line 3933 ../lib/Pg/SQL/Parser/SQL.pm
3934 3934 ],
3935 3935 [#Rule expr_18
3936 3936 'expr', 3,
3937 3937 sub {
3938   -#line 58 "SQL.eyp"
  3938 +#line 59 "SQL.eyp"
3939 3939 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3940 3940 #line 3940 ../lib/Pg/SQL/Parser/SQL.pm
3941 3941 ],
3942 3942 [#Rule expr_19
3943 3943 'expr', 3,
3944 3944 sub {
3945   -#line 59 "SQL.eyp"
  3945 +#line 60 "SQL.eyp"
3946 3946 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3947 3947 #line 3947 ../lib/Pg/SQL/Parser/SQL.pm
3948 3948 ],
3949 3949 [#Rule expr_20
3950 3950 'expr', 3,
3951 3951 sub {
3952   -#line 60 "SQL.eyp"
  3952 +#line 61 "SQL.eyp"
3953 3953 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3954 3954 #line 3954 ../lib/Pg/SQL/Parser/SQL.pm
3955 3955 ],
3956 3956 [#Rule expr_21
3957 3957 'expr', 3,
3958 3958 sub {
3959   -#line 61 "SQL.eyp"
  3959 +#line 62 "SQL.eyp"
3960 3960 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3961 3961 #line 3961 ../lib/Pg/SQL/Parser/SQL.pm
3962 3962 ],
3963 3963 [#Rule expr_22
3964 3964 'expr', 3,
3965 3965 sub {
3966   -#line 62 "SQL.eyp"
  3966 +#line 63 "SQL.eyp"
3967 3967 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3968 3968 #line 3968 ../lib/Pg/SQL/Parser/SQL.pm
3969 3969 ],
3970 3970 [#Rule expr_23
3971 3971 'expr', 3,
3972 3972 sub {
3973   -#line 63 "SQL.eyp"
  3973 +#line 64 "SQL.eyp"
3974 3974 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3975 3975 #line 3975 ../lib/Pg/SQL/Parser/SQL.pm
3976 3976 ],
3977 3977 [#Rule expr_24
3978 3978 'expr', 3,
3979 3979 sub {
3980   -#line 64 "SQL.eyp"
  3980 +#line 65 "SQL.eyp"
3981 3981 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3982 3982 #line 3982 ../lib/Pg/SQL/Parser/SQL.pm
3983 3983 ],
3984 3984 [#Rule expr_25
3985 3985 'expr', 3,
3986 3986 sub {
3987   -#line 65 "SQL.eyp"
  3987 +#line 66 "SQL.eyp"
3988 3988 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3989 3989 #line 3989 ../lib/Pg/SQL/Parser/SQL.pm
3990 3990 ],
3991 3991 [#Rule expr_26
3992 3992 'expr', 3,
3993 3993 sub {
3994   -#line 66 "SQL.eyp"
  3994 +#line 67 "SQL.eyp"
3995 3995 $factory->make( 'Operation', 'operator' => $_[2], 'left' => $_[1], 'right' => $_[3] ) }
3996 3996 #line 3996 ../lib/Pg/SQL/Parser/SQL.pm
3997 3997 ],
3998 3998 [#Rule expr_27
3999 3999 'expr', 3,
4000 4000 sub {
4001   -#line 67 "SQL.eyp"
  4001 +#line 68 "SQL.eyp"
4002 4002 $factory->make( 'Cast', 'method' => '::', 'value' => $_[1], 'final_type' => $_[3] ) }
4003 4003 #line 4003 ../lib/Pg/SQL/Parser/SQL.pm
4004 4004 ],
4005 4005 [#Rule expr_simple_28
4006 4006 'expr_simple', 1,
4007 4007 sub {
4008   -#line 70 "SQL.eyp"
  4008 +#line 71 "SQL.eyp"
4009 4009 $_[1] }
4010 4010 #line 4010 ../lib/Pg/SQL/Parser/SQL.pm
4011 4011 ],
4012 4012 [#Rule expr_simple_29
4013 4013 'expr_simple', 3,
4014 4014 sub {
4015   -#line 71 "SQL.eyp"
  4015 +#line 72 "SQL.eyp"
4016 4016 $_[2] }
4017 4017 #line 4017 ../lib/Pg/SQL/Parser/SQL.pm
4018 4018 ],
4019 4019 [#Rule literal_value_30
4020 4020 'literal_value', 1,
4021 4021 sub {
4022   -#line 74 "SQL.eyp"
  4022 +#line 75 "SQL.eyp"
4023 4023 $factory->make( 'Literal_Value', 'type', => 'STRING_CONSTANT', 'value' => $_[1] ) }
4024 4024 #line 4024 ../lib/Pg/SQL/Parser/SQL.pm
4025 4025 ],
4026 4026 [#Rule literal_value_31
4027 4027 'literal_value', 1,
4028 4028 sub {
4029   -#line 75 "SQL.eyp"
  4029 +#line 76 "SQL.eyp"
4030 4030 $factory->make( 'Literal_Value', 'type', => 'USTRING_CONSTANT', 'value' => $_[1] ) }
4031 4031 #line 4031 ../lib/Pg/SQL/Parser/SQL.pm
4032 4032 ],
4033 4033 [#Rule literal_value_32
4034 4034 'literal_value', 1,
4035 4035 sub {
4036   -#line 76 "SQL.eyp"
  4036 +#line 77 "SQL.eyp"
4037 4037 $factory->make( 'Literal_Value', 'type', => 'ESTRING_CONSTANT', 'value' => $_[1] ) }
4038 4038 #line 4038 ../lib/Pg/SQL/Parser/SQL.pm
4039 4039 ],
4040 4040 [#Rule literal_value_33
4041 4041 'literal_value', 1,
4042 4042 sub {
4043   -#line 77 "SQL.eyp"
  4043 +#line 78 "SQL.eyp"
4044 4044 $factory->make( 'Literal_Value', 'type', => 'BITSTRING_CONSTANT', 'value' => $_[1] ) }
4045 4045 #line 4045 ../lib/Pg/SQL/Parser/SQL.pm
4046 4046 ],
4047 4047 [#Rule literal_value_34
4048 4048 'literal_value', 1,
4049 4049 sub {
4050   -#line 78 "SQL.eyp"
  4050 +#line 79 "SQL.eyp"
4051 4051 $factory->make( 'Literal_Value', 'type', => 'XBITSTRING_CONSTANT', 'value' => $_[1] ) }
4052 4052 #line 4052 ../lib/Pg/SQL/Parser/SQL.pm
4053 4053 ],
4054 4054 [#Rule literal_value_35
4055 4055 'literal_value', 1,
4056 4056 sub {
4057   -#line 79 "SQL.eyp"
  4057 +#line 80 "SQL.eyp"
4058 4058 $factory->make( 'Literal_Value', 'type', => 'NUMERIC_CONSTANT', 'value' => $_[1] ) }
4059 4059 #line 4059 ../lib/Pg/SQL/Parser/SQL.pm
4060 4060 ],
4061 4061 [#Rule literal_value_36
4062 4062 'literal_value', 1,
4063 4063 sub {
4064   -#line 80 "SQL.eyp"
  4064 +#line 81 "SQL.eyp"
4065 4065 $factory->make( 'Literal_Value', 'type', => 'INTEGER_CONSTANT', 'value' => $_[1] ) }
4066 4066 #line 4066 ../lib/Pg/SQL/Parser/SQL.pm
4067 4067 ],
4068 4068 [#Rule identifier_37
4069 4069 'identifier', 1,
4070 4070 sub {
4071   -#line 83 "SQL.eyp"
  4071 +#line 84 "SQL.eyp"
4072 4072 $_[1] }
4073 4073 #line 4073 ../lib/Pg/SQL/Parser/SQL.pm
4074 4074 ],
4075 4075 [#Rule identifier_38
4076 4076 'identifier', 1,
4077 4077 sub {
4078   -#line 84 "SQL.eyp"
  4078 +#line 85 "SQL.eyp"
4079 4079 $_[1] }
4080 4080 #line 4080 ../lib/Pg/SQL/Parser/SQL.pm
4081 4081 ],
4082 4082 [#Rule identifier_39
4083 4083 'identifier', 1,
4084 4084 sub {
4085   -#line 85 "SQL.eyp"
  4085 +#line 86 "SQL.eyp"
4086 4086 $_[1] }
4087 4087 #line 4087 ../lib/Pg/SQL/Parser/SQL.pm
4088 4088 ],
4089 4089 [#Rule identifier_40
4090 4090 'identifier', 1,
4091 4091 sub {
4092   -#line 86 "SQL.eyp"
  4092 +#line 87 "SQL.eyp"
4093 4093 $_[1] }
4094 4094 #line 4094 ../lib/Pg/SQL/Parser/SQL.pm
4095 4095 ],
4096 4096 [#Rule normal_type_41
4097 4097 'normal_type', 1,
4098 4098 sub {
4099   -#line 89 "SQL.eyp"
  4099 +#line 90 "SQL.eyp"
4100 4100 $_[1] }
4101 4101 #line 4101 ../lib/Pg/SQL/Parser/SQL.pm
4102 4102 ],
4103 4103 [#Rule normal_type_42
4104 4104 'normal_type', 3,
4105 4105 sub {
4106   -#line 90 "SQL.eyp"
  4106 +#line 91 "SQL.eyp"
4107 4107 $_[3]->schema( $_[1] ); $_[3] }
4108 4108 #line 4108 ../lib/Pg/SQL/Parser/SQL.pm
4109 4109 ],
4110 4110 [#Rule simple_type_43
4111 4111 'simple_type', 1,
4112 4112 sub {
4113   -#line 93 "SQL.eyp"
  4113 +#line 94 "SQL.eyp"
4114 4114 $factory->make( 'Type', 'name' => $_[1] ) }
4115 4115 #line 4115 ../lib/Pg/SQL/Parser/SQL.pm
4116 4116 ],
4117 4117 [#Rule simple_type_44
4118 4118 'simple_type', 1,
4119 4119 sub {
4120   -#line 94 "SQL.eyp"
  4120 +#line 95 "SQL.eyp"
4121 4121 $factory->make( 'Type', 'name' => $_[1] ) }
4122 4122 #line 4122 ../lib/Pg/SQL/Parser/SQL.pm
4123 4123 ],
4124 4124 [#Rule simple_type_45
4125 4125 'simple_type', 1,
4126 4126 sub {
4127   -#line 95 "SQL.eyp"
  4127 +#line 96 "SQL.eyp"
4128 4128 $factory->make( 'Type', 'name' => $_[1] ) }
4129 4129 #line 4129 ../lib/Pg/SQL/Parser/SQL.pm
4130 4130 ],
4131 4131 [#Rule simple_type_46
4132 4132 'simple_type', 4,
4133 4133 sub {
4134   -#line 96 "SQL.eyp"
  4134 +#line 97 "SQL.eyp"
4135 4135 $factory->make( 'Type', 'name' => $_[1], 'limits' => [ $_[3] ] ) }
4136 4136 #line 4136 ../lib/Pg/SQL/Parser/SQL.pm
4137 4137 ],
4138 4138 [#Rule simple_type_47
4139 4139 'simple_type', 6,
4140 4140 sub {
4141   -#line 97 "SQL.eyp"
  4141 +#line 98 "SQL.eyp"
4142 4142 $factory->make( 'Type', 'name' => $_[1], 'limits' => [ $_[3], $_[5] ] ) }
4143 4143 #line 4143 ../lib/Pg/SQL/Parser/SQL.pm
4144 4144 ],
4145 4145 [#Rule simple_type_48
4146 4146 'simple_type', 4,
4147 4147 sub {
4148   -#line 98 "SQL.eyp"
  4148 +#line 99 "SQL.eyp"
4149 4149 $factory->make( 'Type', 'name' => $_[1], 'limits' => [ $_[3] ] ) }
4150 4150 #line 4150 ../lib/Pg/SQL/Parser/SQL.pm
4151 4151 ],
4152 4152 [#Rule simple_type_49
4153 4153 'simple_type', 6,
4154 4154 sub {
4155   -#line 99 "SQL.eyp"
  4155 +#line 100 "SQL.eyp"
4156 4156 $factory->make( 'Type', 'name' => $_[1], 'limits' => [ $_[3], $_[5] ] ) }
4157 4157 #line 4157 ../lib/Pg/SQL/Parser/SQL.pm
4158 4158 ],
4159 4159 [#Rule simple_type_50
4160 4160 'simple_type', 4,
4161 4161 sub {
4162   -#line 100 "SQL.eyp"
  4162 +#line 101 "SQL.eyp"
4163 4163 $factory->make( 'Type', 'name' => $_[1], 'limits' => [ $_[3] ] ) }
4164 4164 #line 4164 ../lib/Pg/SQL/Parser/SQL.pm
4165 4165 ],
@@ -5817,7 +5817,7 @@ sub {
5817 5817 $self;
5818 5818 }
5819 5819
5820   -#line 426 "SQL.eyp"
  5820 +#line 427 "SQL.eyp"
5821 5821
5822 5822
5823 5823 # vim: set ft=lex:

0 comments on commit 4910509

Please sign in to comment.
Something went wrong with that request. Please try again.