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

View File

@ -863,7 +863,7 @@
"members": [
{
"type": "FIELD",
"name": "function_name",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "_name"
@ -6349,8 +6349,20 @@
"name": "tick"
},
{
"type": "SYMBOL",
"name": "identifier"
"type": "ALIAS",
"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",
"_name"
],
[
"_name",
"component_choice_list"
],
[
"record_component_association_list",
"positional_array_aggregate"
@ -14616,14 +14624,6 @@
"generic_instantiation",
"procedure_specification"
],
[
"generic_package_declaration",
"_package_declaration"
],
[
"attribute_definition_clause",
"_attribute_reference"
],
[
"_defining_identifier_list",
"object_renaming_declaration",
@ -14663,32 +14663,23 @@
"derived_type_definition"
],
[
"_name",
"subprogram_body"
"formal_derived_type_definition"
],
[
"function_call",
"procedure_call_statement"
],
[
"function_call",
"_name"
],
[
"formal_derived_type_definition"
],
[
"_name",
"_aspect_mark"
],
[
"_name",
"_attribute_reference",
"qualified_expression"
"package_body_stub"
],
[
"_name",
"package_body_stub"
"attribute_definition_clause",
"_attribute_reference"
]
],
"precedences": [],

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -70,3 +70,24 @@ end;
(expression
(term
(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)))))