Support for task types
This commit is contained in:
parent
4433fab200
commit
e5245e8283
|
|
@ -140,3 +140,62 @@ end P;
|
||||||
(identifier)))))
|
(identifier)))))
|
||||||
(name
|
(name
|
||||||
(identifier))))))
|
(identifier))))))
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
Task types
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
package body P is
|
||||||
|
task type T1;
|
||||||
|
task type T is
|
||||||
|
entry E (A : Integer);
|
||||||
|
end T;
|
||||||
|
task type T2 is new T with
|
||||||
|
entry E2;
|
||||||
|
end T2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(compilation
|
||||||
|
(compilation_unit
|
||||||
|
(proper_body
|
||||||
|
(package_body
|
||||||
|
(name
|
||||||
|
(identifier))
|
||||||
|
(non_empty_declarative_part
|
||||||
|
(declarative_item_pragma
|
||||||
|
(type_declaration
|
||||||
|
(full_type_declaration
|
||||||
|
(task_type_declaration
|
||||||
|
(identifier)))))
|
||||||
|
(declarative_item_pragma
|
||||||
|
(type_declaration
|
||||||
|
(full_type_declaration
|
||||||
|
(task_type_declaration
|
||||||
|
(identifier)
|
||||||
|
(task_definition
|
||||||
|
(task_item
|
||||||
|
(entry_declaration
|
||||||
|
(identifier)
|
||||||
|
(formal_part
|
||||||
|
(parameter_specification_list
|
||||||
|
(parameter_specification
|
||||||
|
(defining_identifier_list
|
||||||
|
(identifier))
|
||||||
|
(name
|
||||||
|
(identifier)))))))
|
||||||
|
(identifier))))))
|
||||||
|
(declarative_item_pragma
|
||||||
|
(type_declaration
|
||||||
|
(full_type_declaration
|
||||||
|
(task_type_declaration
|
||||||
|
(identifier)
|
||||||
|
(interface_list
|
||||||
|
(name
|
||||||
|
(identifier)))
|
||||||
|
(task_definition
|
||||||
|
(task_item
|
||||||
|
(entry_declaration
|
||||||
|
(identifier)))
|
||||||
|
(identifier)))))))))))
|
||||||
|
|
|
||||||
19
grammar.js
19
grammar.js
|
|
@ -763,7 +763,7 @@ module.exports = grammar({
|
||||||
optional($.aspect_specification),
|
optional($.aspect_specification),
|
||||||
';',
|
';',
|
||||||
),
|
),
|
||||||
// $.task_type_declaration,
|
$.task_type_declaration,
|
||||||
// $.protected_type_declaration,
|
// $.protected_type_declaration,
|
||||||
),
|
),
|
||||||
private_type_declaration: $ => seq(
|
private_type_declaration: $ => seq(
|
||||||
|
|
@ -1179,6 +1179,23 @@ module.exports = grammar({
|
||||||
optional($.aspect_specification),
|
optional($.aspect_specification),
|
||||||
';',
|
';',
|
||||||
),
|
),
|
||||||
|
task_type_declaration: $ => seq(
|
||||||
|
reservedWord('task'),
|
||||||
|
reservedWord('type'),
|
||||||
|
$.identifier,
|
||||||
|
optional($.known_discriminant_part),
|
||||||
|
optional($.aspect_specification),
|
||||||
|
optional(seq(
|
||||||
|
reservedWord('is'),
|
||||||
|
optional(seq(
|
||||||
|
reservedWord('new'),
|
||||||
|
$.interface_list,
|
||||||
|
reservedWord('with'),
|
||||||
|
)),
|
||||||
|
$.task_definition,
|
||||||
|
)),
|
||||||
|
';',
|
||||||
|
),
|
||||||
protected_body_stub: $ => seq(
|
protected_body_stub: $ => seq(
|
||||||
reservedWord('protected'),
|
reservedWord('protected'),
|
||||||
reservedWord('body'),
|
reservedWord('body'),
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"generate": "tree-sitter generate",
|
"generate": "tree-sitter generate",
|
||||||
"test": "tree-sitter generate && time tree-sitter test",
|
"test": "tree-sitter generate && time tree-sitter test",
|
||||||
|
"testquick": "time tree-sitter test",
|
||||||
"update-test": "tree-sitter test --update"
|
"update-test": "tree-sitter test --update"
|
||||||
},
|
},
|
||||||
"main": "bindings/node"
|
"main": "bindings/node"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user