Fix support for Func(...).Value
Need to set associativity on selected_component
This commit is contained in:
parent
7bd8543b71
commit
ec82f7b2cf
16
grammar.js
16
grammar.js
|
|
@ -106,10 +106,6 @@ module.exports = grammar({
|
|||
[$._name, $.package_body_stub],
|
||||
|
||||
],
|
||||
inline: $ => [
|
||||
// To avoid conflicts
|
||||
$.selected_component,
|
||||
],
|
||||
|
||||
rules: {
|
||||
compilation: $ => repeat(
|
||||
|
|
@ -145,13 +141,17 @@ module.exports = grammar({
|
|||
$.string_literal, // name of an operator. However, in a number of
|
||||
// places using a string doesn't make sense.
|
||||
),
|
||||
selected_component: $ => seq( // RM 4.1.3
|
||||
$.identifier,
|
||||
selected_component: $ => prec.left(seq( // RM 4.1.3
|
||||
field('prefix', $._name),
|
||||
seq(
|
||||
'.',
|
||||
$._name,
|
||||
),
|
||||
field('selector_name', choice(
|
||||
$.identifier,
|
||||
$.character_literal,
|
||||
$.string_literal,
|
||||
)),
|
||||
),
|
||||
)),
|
||||
target_name: $ => '@', // RM 5.2.1
|
||||
_name_list: $ => prec.left(comma_separated_list_of($._name)),
|
||||
_defining_identifier_list: $ => comma_separated_list_of($.identifier),
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@
|
|||
(comment) @spell ;; spell-check comments
|
||||
(string_literal) @string
|
||||
(string_literal) @spell ;; spell-check strings
|
||||
(character_literal) @string
|
||||
(identifier) @variable
|
||||
(numeric_literal) @number
|
||||
|
||||
|
|
@ -141,6 +142,7 @@
|
|||
(range_constraint "range" @type.definition)
|
||||
(signed_integer_type_definition "range" @type.definition)
|
||||
(index_subtype_definition "range" @type.definition)
|
||||
(private_type_declaration "is" @type.definition "private" @type.definition)
|
||||
|
||||
;; Gray the body of expression functions
|
||||
(expression_function_declaration
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
;; references. However, this is not yet supported by neovim
|
||||
;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
|
||||
|
||||
(compilation) @scope
|
||||
(package_specification) @scope
|
||||
(procedure_specification) @scope
|
||||
(function_specification) @scope
|
||||
(package_body) @scope
|
||||
(subprogram_declaration) @scope
|
||||
(subprogram_body) @scope
|
||||
(block_statement) @scope
|
||||
|
||||
(with_clause (identifier) @definition.import)
|
||||
|
|
|
|||
|
|
@ -181,11 +181,18 @@
|
|||
]
|
||||
},
|
||||
"selected_component": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "prefix",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
"name": "_name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
|
|
@ -194,13 +201,31 @@
|
|||
"type": "STRING",
|
||||
"value": "."
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "selector_name",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_name"
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "character_literal"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "string_literal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"target_name": {
|
||||
"type": "STRING",
|
||||
|
|
@ -14609,9 +14634,7 @@
|
|||
],
|
||||
"precedences": [],
|
||||
"externals": [],
|
||||
"inline": [
|
||||
"selected_component"
|
||||
],
|
||||
"inline": [],
|
||||
"supertypes": []
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
75428
src/parser.c
75428
src/parser.c
File diff suppressed because it is too large
Load Diff
|
|
@ -70,15 +70,16 @@ end;
|
|||
(identifier)
|
||||
(expression
|
||||
(term
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier)))))
|
||||
(identifier))))))
|
||||
(statement
|
||||
(procedure_call_statement
|
||||
(selected_component
|
||||
(identifier)
|
||||
(function_call
|
||||
(identifier)
|
||||
(identifier))
|
||||
(actual_parameter_part
|
||||
(parameter_association
|
||||
(expression
|
||||
(term
|
||||
(numeric_literal))))))))))))
|
||||
(numeric_literal)))))))))))
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@ use Ada.Text_IO, System;
|
|||
(compilation
|
||||
(compilation_unit
|
||||
(with_clause
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier)
|
||||
(identifier))
|
||||
(identifier)))
|
||||
(comment)
|
||||
(compilation_unit
|
||||
|
|
@ -29,8 +30,9 @@ use Ada.Text_IO, System;
|
|||
(identifier)))
|
||||
(compilation_unit
|
||||
(use_clause
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier)
|
||||
(identifier))
|
||||
(identifier))))
|
||||
|
||||
================================================================================
|
||||
|
|
@ -72,8 +74,9 @@ end;
|
|||
(identifier)))
|
||||
(compilation_unit
|
||||
(package_specification
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier)
|
||||
(identifier))
|
||||
(comment))))
|
||||
|
||||
================================================================================
|
||||
|
|
@ -94,8 +97,9 @@ end Child.P2;
|
|||
(compilation
|
||||
(compilation_unit
|
||||
(package_body
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier)
|
||||
(identifier))
|
||||
(non_empty_declarative_part
|
||||
(package_body
|
||||
(identifier)
|
||||
|
|
@ -106,8 +110,9 @@ end Child.P2;
|
|||
(handled_sequence_of_statements
|
||||
(statement
|
||||
(null_statement)))
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))))
|
||||
(identifier)))))
|
||||
|
||||
================================================================================
|
||||
separate
|
||||
|
|
|
|||
|
|
@ -33,8 +33,9 @@ end P;
|
|||
(identifier))
|
||||
(package_renaming_declaration
|
||||
(identifier)
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))
|
||||
(identifier)))
|
||||
(subprogram_renaming_declaration
|
||||
(procedure_specification
|
||||
(identifier)
|
||||
|
|
|
|||
|
|
@ -101,13 +101,14 @@ end P;
|
|||
(statement
|
||||
(loop_statement
|
||||
(iteration_scheme
|
||||
(iterator_specification
|
||||
(identifier)
|
||||
(loop_parameter_specification
|
||||
(identifier)
|
||||
(range_g
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))
|
||||
(tick)
|
||||
(attribute_designator
|
||||
(identifier))))
|
||||
(range_attribute_designator))))
|
||||
(statement
|
||||
(goto_statement
|
||||
(identifier)))
|
||||
|
|
@ -472,8 +473,9 @@ end;
|
|||
(term
|
||||
(allocator
|
||||
(subpool_specification
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))
|
||||
(identifier)))
|
||||
(qualified_expression
|
||||
(identifier)
|
||||
(tick)
|
||||
|
|
@ -542,9 +544,10 @@ end;
|
|||
(handled_sequence_of_statements
|
||||
(statement
|
||||
(assignment_statement
|
||||
(identifier)
|
||||
(function_call
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))
|
||||
(actual_parameter_part
|
||||
(parameter_association
|
||||
(expression
|
||||
|
|
@ -558,9 +561,10 @@ end;
|
|||
(numeric_literal)))))
|
||||
(statement
|
||||
(assignment_statement
|
||||
(identifier)
|
||||
(function_call
|
||||
(selected_component
|
||||
(identifier)
|
||||
(identifier))
|
||||
(actual_parameter_part
|
||||
(parameter_association
|
||||
(expression
|
||||
|
|
|
|||
|
|
@ -499,3 +499,28 @@ procedure Proc (A : access Integer);
|
|||
(identifier)
|
||||
(access_definition
|
||||
(identifier))))))))
|
||||
|
||||
================================================================================
|
||||
Subprogram and field access
|
||||
================================================================================
|
||||
|
||||
V := Func (2).Value;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(compilation
|
||||
(compilation_unit
|
||||
(statement
|
||||
(assignment_statement
|
||||
(identifier)
|
||||
(expression
|
||||
(term
|
||||
(selected_component
|
||||
(function_call
|
||||
(identifier)
|
||||
(actual_parameter_part
|
||||
(parameter_association
|
||||
(expression
|
||||
(term
|
||||
(numeric_literal))))))
|
||||
(identifier))))))))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user