Remove no longer needed conflict clauses

This commit is contained in:
Emmanuel Briot 2022-12-12 11:39:57 +01:00
parent 4557f68292
commit 30545542d7
5 changed files with 720 additions and 718 deletions

View File

@ -51,7 +51,6 @@ module.exports = grammar({
[$.at_clause, $._name], [$.at_clause, $._name],
// 'case' '(' identifier . '=>' ... // 'case' '(' identifier . '=>' ...
// ??? Invalid Ada
[$._name, $.component_choice_list], [$._name, $.component_choice_list],
// 'case' '(' expression . ',' ... // 'case' '(' expression . ',' ...
@ -64,11 +63,6 @@ module.exports = grammar({
// a generic_instantiation. // a generic_instantiation.
[$.generic_instantiation, $.procedure_specification], [$.generic_instantiation, $.procedure_specification],
// Same for "package_specification ;"
[$.generic_package_declaration, $._package_declaration],
[$.attribute_definition_clause, $._attribute_reference],
// identifier . ':' ... // identifier . ':' ...
[$._defining_identifier_list, $.object_renaming_declaration, [$._defining_identifier_list, $.object_renaming_declaration,
$.exception_renaming_declaration], $.exception_renaming_declaration],
@ -81,30 +75,31 @@ module.exports = grammar({
[$.generic_formal_part, $.generic_renaming_declaration], [$.generic_formal_part, $.generic_renaming_declaration],
// 'type' identifier 'is' 'new' _subtype_indication . 'with' // 'type' identifier 'is' 'new' _subtype_indication . 'with'
// which could be either a record_extension_part or // could be either a record_extension_part or an aspect_specification.
// an aspect_specification.
[$.derived_type_definition], [$.derived_type_definition],
// 'for' name 'use' '(' 'for' identifier 'in' name . 'use' // 'for' name 'use' '(' 'for' identifier 'in' name . 'use'
[$.iterator_specification, $._subtype_indication], [$.iterator_specification, $._subtype_indication],
// 'type' identifier known_discriminant_part . 'is' ... // 'type' identifier known_discriminant_part . 'is' ...
// This could be either a _discriminant_part or known_discriminant_part,
// the latter in case we are declaring a private type. We can't make the
// difference until we have seen "private".
[$.full_type_declaration, $._discriminant_part], [$.full_type_declaration, $._discriminant_part],
// 'type' identifier 'is' 'new' _subtype_indication . 'with' . // 'type' identifier 'is' 'new' _subtype_indication . 'with' .
[$.private_extension_declaration, $.derived_type_definition], [$.private_extension_declaration, $.derived_type_definition],
// _subprogram_specification 'is' 'begin' // 'generic' 'type' identifier 'is' 'new' _name . 'with' ...
// handled_sequence_of_statements 'end' string_literal . ';' // The with could be either part of formal_derived_type_definition, as
[$._name, $.subprogram_body], // "is new Foo with private", or an aspect
// (via formal_complete_type_declaration)
[$.formal_derived_type_definition],
[$.function_call, $.procedure_call_statement], [$.function_call, $.procedure_call_statement],
[$.function_call, $._name],
[$.formal_derived_type_definition],
[$._name, $._aspect_mark], [$._name, $._aspect_mark],
[$._name, $._attribute_reference, $.qualified_expression],
[$._name, $.package_body_stub], [$._name, $.package_body_stub],
[$.attribute_definition_clause, $._attribute_reference],
], ],
rules: { rules: {
@ -255,8 +250,8 @@ module.exports = grammar({
reservedWord('mod'), reservedWord('mod'),
), ),
function_call: $ => seq( // ARM 6.4 function_call: $ => seq( // ARM 6.4
field('function_name', $._name), field('name', $._name),
$.actual_parameter_part, $.actual_parameter_part, // should be optional, but covered by _name
), ),
qualified_expression: $ => seq( // ARM 4.7 qualified_expression: $ => seq( // ARM 4.7
field('subtype_name', $._name), field('subtype_name', $._name),
@ -810,16 +805,16 @@ module.exports = grammar({
optional($.aspect_specification), optional($.aspect_specification),
';', ';',
), ),
_discriminant_part: $ => choice( _discriminant_part: $ => choice( // ARM 3.7
$.known_discriminant_part, $.known_discriminant_part,
$.unknown_discriminant_part, $.unknown_discriminant_part,
), ),
unknown_discriminant_part: $ => seq( unknown_discriminant_part: $ => seq( // ARM 3.7
'(', '(',
'<>', '<>',
')', ')',
), ),
known_discriminant_part: $ => seq( known_discriminant_part: $ => seq( // ARM 3.7
'(', '(',
$.discriminant_specification_list, $.discriminant_specification_list,
')', ')',
@ -1110,11 +1105,11 @@ module.exports = grammar({
$.expression, $.expression,
$.global_aspect_definition, $.global_aspect_definition,
), ),
_aspect_mark: $ => seq( _aspect_mark: $ => seq( // ARM 13.1.1
$.identifier, $.identifier,
optional(seq( optional(seq(
$.tick, $.tick,
$.identifier, reservedWord('Class'),
)), )),
), ),
aspect_mark_list: $ => comma_separated_list_of($.aspect_association), aspect_mark_list: $ => comma_separated_list_of($.aspect_association),
@ -2203,7 +2198,7 @@ module.exports = grammar({
$.access_definition, $.access_definition,
), ),
procedure_call_statement: $ => seq( // ARM 6.4 procedure_call_statement: $ => seq( // ARM 6.4
field('name', $._name), // not an operator field('name', $._name),
optional($.actual_parameter_part), optional($.actual_parameter_part),
';', ';',
), ),

View File

@ -863,7 +863,7 @@
"members": [ "members": [
{ {
"type": "FIELD", "type": "FIELD",
"name": "function_name", "name": "name",
"content": { "content": {
"type": "SYMBOL", "type": "SYMBOL",
"name": "_name" "name": "_name"
@ -6349,8 +6349,20 @@
"name": "tick" "name": "tick"
}, },
{ {
"type": "SYMBOL", "type": "ALIAS",
"name": "identifier" "content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 2,
"content": {
"type": "PATTERN",
"value": "[CC][lL][aA][sS][sS]"
}
}
},
"named": false,
"value": "Class"
} }
] ]
}, },
@ -14600,10 +14612,6 @@
"at_clause", "at_clause",
"_name" "_name"
], ],
[
"_name",
"component_choice_list"
],
[ [
"record_component_association_list", "record_component_association_list",
"positional_array_aggregate" "positional_array_aggregate"
@ -14616,14 +14624,6 @@
"generic_instantiation", "generic_instantiation",
"procedure_specification" "procedure_specification"
], ],
[
"generic_package_declaration",
"_package_declaration"
],
[
"attribute_definition_clause",
"_attribute_reference"
],
[ [
"_defining_identifier_list", "_defining_identifier_list",
"object_renaming_declaration", "object_renaming_declaration",
@ -14663,32 +14663,23 @@
"derived_type_definition" "derived_type_definition"
], ],
[ [
"_name", "formal_derived_type_definition"
"subprogram_body"
], ],
[ [
"function_call", "function_call",
"procedure_call_statement" "procedure_call_statement"
], ],
[
"function_call",
"_name"
],
[
"formal_derived_type_definition"
],
[ [
"_name", "_name",
"_aspect_mark" "_aspect_mark"
], ],
[ [
"_name", "_name",
"_attribute_reference", "package_body_stub"
"qualified_expression"
], ],
[ [
"_name", "attribute_definition_clause",
"package_body_stub" "_attribute_reference"
] ]
], ],
"precedences": [], "precedences": [],

View File

@ -4960,7 +4960,7 @@
"type": "function_call", "type": "function_call",
"named": true, "named": true,
"fields": { "fields": {
"function_name": { "name": {
"multiple": true, "multiple": true,
"required": true, "required": true,
"types": [ "types": [

File diff suppressed because it is too large Load Diff

View File

@ -70,3 +70,24 @@ end;
(expression (expression
(term (term
(string_literal))))))))) (string_literal)))))))))
================================================================================
formal derived types
================================================================================
generic
type T is new P with private;
procedure A;
--------------------------------------------------------------------------------
(compilation
(compilation_unit
(generic_subprogram_declaration
(generic_formal_part
(formal_complete_type_declaration
(identifier)
(formal_derived_type_definition
(identifier))))
(procedure_specification
(identifier)))))