@@ -683,23 +683,93 @@ primitive_type
683
683
684
684
record_type :: { PrimaryType Annotation }
685
685
record_type
686
- : ' xxx' { RecordType [] Nothing }
686
+ : ' [' ' ...' ' ]' { RecordType [] (Just Annotation) }
687
+ | ' [' field_specification_list ' ]' { RecordType $2 (Just Annotation) }
688
+ | ' [' field_specification_list ' ,' ' ...' ' ]' { RecordType $2 (Just Annotation) }
689
+
690
+ field_specification_list :: { [FieldSpecification Annotation] }
691
+ field_specification_list
692
+ : field_specification { [$1] }
693
+ | field_specification ' ,' field_specification_list { $1:$3 }
694
+
695
+ field_specification :: { FieldSpecification Annotation }
696
+ field_specification
697
+ : optional__opt ' identifier' field_type_specification__opt { FieldSpecification (getIdent $2) $3 $1 (Just Annotation) }
698
+
699
+ optional__opt :: { Bool }
700
+ optional__opt
701
+ : ' optional' { True }
702
+ | {- empty -} { False }
703
+
704
+ field_type_specification__opt :: { Maybe (Type Annotation) }
705
+ field_type_specification__opt
706
+ : field_type_specification { Just $1 }
707
+ | {- empty -} { Nothing }
708
+
709
+ field_type_specification :: { Type Annotation }
710
+ field_type_specification
711
+ : ' =' field_type { $2 }
712
+
713
+ field_type :: { Type Annotation }
714
+ field_type
715
+ : type { $1 }
687
716
688
717
list_type :: { PrimaryType Annotation }
689
718
list_type
690
- : ' xxx' { ListType undefined Nothing }
719
+ : ' {' item_type ' }' { ListType $2 (Just Annotation) }
720
+
721
+ item_type :: { Type Annotation }
722
+ item_type
723
+ : type { $1 }
691
724
692
725
function_type :: { PrimaryType Annotation }
693
726
function_type
694
- : ' xxx' { FunctionType undefined TypeAny Nothing }
727
+ : ' function' ' (' parameter_specification_list__opt ' )' return_type { FunctionType $3 $5 (Just Annotation) }
728
+
729
+ parameter_specification_list__opt :: { Maybe [ParameterSpecification Annotation] }
730
+ parameter_specification_list__opt
731
+ : parameter_specification_list { Just $1 }
732
+ | {- empty -} { Nothing }
733
+
734
+ parameter_specification_list :: { [ParameterSpecification Annotation] }
735
+ parameter_specification_list
736
+ : required_parameter_specification_list { $1 }
737
+ | required_parameter_specification_list ' ,' optional_parameter_specification_list { $1 <> $3 }
738
+ | optional_parameter_specification_list { $1 }
739
+
740
+ required_parameter_specification_list :: { [ParameterSpecification Annotation] }
741
+ required_parameter_specification_list
742
+ : required_parameter_specification { [$1] }
743
+ | required_parameter_specification ' ,' required_parameter_specification_list { $1:$3 }
744
+
745
+ required_parameter_specification :: { ParameterSpecification Annotation }
746
+ required_parameter_specification
747
+ : parameter_specification { $1 }
748
+
749
+ optional_parameter_specification_list :: { [ParameterSpecification Annotation] }
750
+ optional_parameter_specification_list
751
+ : optional_parameter_specification { [$1] }
752
+ | optional_parameter_specification ' ,' optional_parameter_specification_list { $1:$3 }
753
+
754
+ optional_parameter_specification :: { ParameterSpecification Annotation }
755
+ optional_parameter_specification
756
+ : ' optional' parameter_specification { $2 { _parameterSpecification_optional = True} }
757
+
758
+ parameter_specification :: { ParameterSpecification Annotation }
759
+ parameter_specification
760
+ : parameter_name parameter_type { ParameterSpecification $1 (Just $2) False (Just Annotation) }
695
761
696
762
table_type :: { PrimaryType Annotation }
697
763
table_type
698
- : ' xxx' { TableType [] Nothing }
764
+ : ' table' row_type { TableType $2 (Just Annotation) }
765
+
766
+ row_type :: { [FieldSpecification Annotation] }
767
+ row_type
768
+ : ' [' field_specification_list ' ]' { $2 }
699
769
700
770
nullable_type :: { PrimaryType Annotation }
701
771
nullable_type
702
- : ' xxx ' { NullableType undefined Nothing }
772
+ : ' nullable ' type { NullableType $2 (Just Annotation) }
703
773
704
774
-- 12.2.3.26 - Error raising expression
705
775
error_raising_expression :: { ErrorRaisingExpression Annotation }
0 commit comments