UNPKG

tm-grammars

Version:
2,191 lines 88.3 kB
{ "displayName": "Ada", "name": "ada", "patterns": [ { "include": "#library_unit" }, { "include": "#comment" }, { "include": "#use_clause" }, { "include": "#with_clause" }, { "include": "#pragma" }, { "include": "#keyword" } ], "repository": { "abort_statement": { "begin": "(?i)\\babort\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.abort.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([._\\w\\d])+\\b", "name": "entity.name.task.ada" } ] }, "accept_statement": { "begin": "(?i)\\b(accept)\\s+([._\\w\\d]+)\\b", "beginCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "entity.name.accept.ada" } }, "end": "(?i)(?:\\b(end)\\s*(\\s\\2)?\\s*)?(;)", "endCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "entity.name.accept.ada" }, "3": { "name": "punctuation.ada" } }, "name": "meta.statement.accept.ada", "patterns": [ { "begin": "(?i)\\bdo\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)\\b(?=end)\\b", "patterns": [ { "include": "#statement" } ] }, { "include": "#parameter_profile" } ] }, "access_definition": { "captures": { "1": { "name": "storage.visibility.ada" }, "2": { "name": "storage.visibility.ada" }, "3": { "name": "storage.modifier.ada" }, "4": { "name": "entity.name.type.ada" } }, "match": "(?i)(not\\s+null\\s+)?(access)\\s+(constant\\s+)?([._\\w\\d]+)\\b", "name": "meta.declaration.access.definition.ada" }, "access_type_definition": { "begin": "(?i)\\b(not\\s+null\\s+)?(access)\\b", "beginCaptures": { "1": { "name": "storage.visibility.ada" }, "2": { "name": "storage.visibility.ada" } }, "end": "(?i)(?=(with|;))", "name": "meta.declaration.type.definition.access.ada", "patterns": [ { "match": "(?i)\\ball\\b", "name": "storage.visibility.ada" }, { "match": "(?i)\\bconstant\\b", "name": "storage.modifier.ada" }, { "include": "#subtype_mark" } ] }, "actual_parameter_part": { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "include": "#parameter_association" } ] }, "adding_operator": { "match": "([-\\&+])", "name": "keyword.operator.adding.ada" }, "array_aggregate": { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "name": "meta.definition.array.aggregate.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "include": "#positional_array_aggregate" }, { "include": "#array_component_association" } ] }, "array_component_association": { "captures": { "1": { "name": "variable.name.ada" }, "2": { "name": "keyword.other.ada" }, "3": { "patterns": [ { "match": "<>", "name": "keyword.modifier.unknown.ada" }, { "include": "#expression" } ] } }, "match": "(?i)\\b([^()=>]*)\\s*(=>)\\s*([^),]+)", "name": "meta.definition.array.aggregate.component.ada" }, "array_dimensions": { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "name": "meta.declaration.type.definition.array.dimensions.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "(?i)\\brange\\b", "name": "storage.modifier.ada" }, { "match": "<>", "name": "keyword.modifier.unknown.ada" }, { "match": "\\.\\.", "name": "keyword.ada" }, { "include": "#expression" }, { "patterns": [ { "include": "#subtype_mark" } ] } ] }, "array_type_definition": { "begin": "(?i)\\barray\\b", "beginCaptures": { "0": { "name": "storage.modifier.ada" } }, "end": "(?i)(?=(with|;))", "name": "meta.declaration.type.definition.array.ada", "patterns": [ { "include": "#array_dimensions" }, { "match": "(?i)\\bof\\b", "name": "storage.modifier.ada" }, { "match": "(?i)\\baliased\\b", "name": "storage.visibility.ada" }, { "include": "#access_definition" }, { "include": "#subtype_mark" } ] }, "aspect_clause": { "begin": "(?i)\\b(for)\\b", "beginCaptures": { "1": { "name": "keyword.ada" }, "2": { "patterns": [ { "include": "#subtype_mark" } ] }, "3": { "name": "punctuation.ada" }, "5": { "name": "keyword.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.aspect.clause.ada", "patterns": [ { "begin": "(?i)\\buse\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?=;)", "endCaptures": { "0": { "name": "punctuation.ada" } }, "patterns": [ { "include": "#record_representation_clause" }, { "include": "#array_aggregate" }, { "include": "#expression" } ] }, { "begin": "(?i)(?<=for)", "captures": { "0": { "name": "keyword.ada" } }, "end": "(?i)(?=use)", "patterns": [ { "captures": { "1": { "patterns": [ { "include": "#subtype_mark" } ] }, "2": { "patterns": [ { "include": "#attribute" } ] } }, "match": "([_\\w\\d]+)('([_\\w\\d]+))?" } ] } ] }, "aspect_definition": { "begin": "=>", "beginCaptures": { "0": { "name": "keyword.other.ada" } }, "end": "(?i)(?=([,;]|\\bis\\b))", "name": "meta.aspect.definition.ada", "patterns": [ { "include": "#expression" } ] }, "aspect_mark": { "captures": { "1": { "name": "keyword.control.directive.ada" }, "2": { "name": "punctuation.ada" }, "3": { "name": "entity.other.attribute-name.ada" } }, "match": "(?i)\\b([._\\w\\d]+)(?:(')(class))?\\b", "name": "meta.aspect.mark.ada" }, "aspect_specification": { "begin": "(?i)\\bwith\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)(?=(;|\\bis\\b))", "name": "meta.aspect.specification.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "captures": { "1": { "name": "storage.modifier.ada" }, "2": { "name": "storage.modifier.ada" } }, "match": "(?i)\\b(null)\\s+(record)\\b" }, { "begin": "(?i)\\brecord\\b", "beginCaptures": { "0": { "name": "storage.modifier.ada" } }, "end": "(?i)\\b(end)\\s+(record)\\b", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "storage.modifier.ada" } }, "patterns": [ { "include": "#component_item" } ] }, { "captures": { "0": { "name": "storage.visibility.ada" } }, "match": "(?i)\\bprivate\\b" }, { "include": "#aspect_definition" }, { "include": "#aspect_mark" }, { "include": "#comment" } ] }, "assignment_statement": { "begin": "\\b([\"'()._\\w\\d\\s]+)\\s*(:=)", "beginCaptures": { "1": { "patterns": [ { "match": "([._\\w\\d]+)", "name": "variable.name.ada" }, { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "patterns": [ { "include": "#expression" } ] } ] }, "2": { "name": "keyword.operator.new.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.assignment.ada", "patterns": [ { "include": "#expression" }, { "include": "#comment" } ] }, "attribute": { "captures": { "1": { "name": "punctuation.ada" }, "2": { "name": "entity.other.attribute-name.ada" } }, "match": "(')([_\\w\\d]+)\\b", "name": "meta.attribute.ada" }, "based_literal": { "captures": { "1": { "name": "constant.numeric.base.ada" }, "2": { "name": "punctuation.ada" }, "3": { "name": "punctuation.ada" }, "4": { "name": "punctuation.radix-point.ada" }, "5": { "name": "punctuation.ada" }, "6": { "name": "constant.numeric.base.ada" }, "7": { "patterns": [ { "include": "#exponent_part" } ] } }, "match": "(?i)(\\d(?:(_)?\\d)*#)[0-9a-f](?:(_)?[0-9a-f])*(?:(\\.)[0-9a-f](?:(_)?[0-9a-f])*)?(#)([Ee][-+]?\\d(?:_?\\d)*)?", "name": "constant.numeric.ada" }, "basic_declaration": { "patterns": [ { "include": "#type_declaration" }, { "include": "#subtype_declaration" }, { "include": "#exception_declaration" }, { "include": "#object_declaration" }, { "include": "#single_protected_declaration" }, { "include": "#single_task_declaration" }, { "include": "#subprogram_specification" }, { "include": "#package_declaration" }, { "include": "#pragma" }, { "include": "#comment" } ] }, "basic_declarative_item": { "patterns": [ { "include": "#basic_declaration" }, { "include": "#aspect_clause" }, { "include": "#use_clause" }, { "include": "#keyword" } ] }, "block_statement": { "begin": "(?i)\\bdeclare\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(end)(\\s+[_\\w\\d]+)?\\s*(;)", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "entity.name.label.ada" }, "3": { "name": "punctuation.ada" } }, "name": "meta.statement.block.ada", "patterns": [ { "begin": "(?i)(?<=declare)", "end": "(?i)\\bbegin\\b", "endCaptures": { "0": { "name": "keyword.ada" } }, "patterns": [ { "include": "#body" }, { "include": "#basic_declarative_item" } ] }, { "begin": "(?i)(?<=begin)", "end": "(?i)(?=end)", "patterns": [ { "include": "#statement" } ] } ] }, "body": { "patterns": [ { "include": "#subprogram_body" }, { "include": "#package_body" }, { "include": "#task_body" }, { "include": "#protected_body" } ] }, "case_statement": { "begin": "(?i)\\bcase\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)\\b(end)\\s+(case)\\s*(;)", "endCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "keyword.control.ada" }, "3": { "name": "punctuation.ada" } }, "name": "meta.statement.case.ada", "patterns": [ { "begin": "(?i)(?<=case)\\b", "end": "(?i)\\bis\\b", "endCaptures": { "0": { "name": "keyword.control.ada" } }, "patterns": [ { "include": "#expression" } ] }, { "begin": "(?i)\\bwhen\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "=>", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.case.alternative.ada", "patterns": [ { "match": "(?i)\\bothers\\b", "name": "keyword.modifier.unknown.ada" }, { "match": "\\|", "name": "punctuation.ada" }, { "include": "#expression" } ] }, { "include": "#statement" } ] }, "character_literal": { "captures": { "0": { "patterns": [ { "match": "'", "name": "punctuation.definition.string.ada" } ] } }, "match": "'.'", "name": "string.quoted.single.ada" }, "comment": { "patterns": [ { "include": "#preprocessor" }, { "include": "#comment-section" }, { "include": "#comment-doc" }, { "include": "#comment-line" } ] }, "comment-doc": { "captures": { "1": { "name": "comment.line.double-dash.ada" }, "2": { "name": "punctuation.definition.tag.ada" }, "3": { "name": "entity.name.tag.ada" }, "4": { "name": "comment.line.double-dash.ada" } }, "match": "(--)\\s*(@)(\\w+)\\s+(.*)$", "name": "comment.block.documentation.ada" }, "comment-line": { "match": "--.*$", "name": "comment.line.double-dash.ada" }, "comment-section": { "captures": { "1": { "name": "entity.name.section.ada" } }, "match": "--\\s*([^-].*?[^-])\\s*--\\s*$", "name": "comment.line.double-dash.ada" }, "component_clause": { "begin": "(?i)\\b([_\\w\\d]+)\\b", "beginCaptures": { "0": { "name": "variable.name.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.aspect.clause.record.representation.component.ada", "patterns": [ { "begin": "(?i)\\bat\\b", "beginCaptures": { "0": { "name": "storage.modifier.ada" } }, "end": "(?i)\\b(?=range)\\b", "patterns": [ { "include": "#expression" } ] }, { "include": "#range_constraint" } ] }, "component_declaration": { "begin": "(?i)\\b([_\\w\\d]+(?:\\s*,\\s*[_\\w\\d]+)?)\\s*(:)", "beginCaptures": { "1": { "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([_\\w\\d])+\\b", "name": "variable.name.ada" } ] }, "2": { "name": "punctuation.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.declaration.type.definition.record.component.ada", "patterns": [ { "patterns": [ { "match": ":=", "name": "keyword.operator.new.ada" }, { "include": "#expression" } ] }, { "include": "#component_definition" } ] }, "component_definition": { "patterns": [ { "match": "(?i)\\baliased\\b", "name": "storage.visibility.ada" }, { "match": "(?i)\\brange\\b", "name": "storage.modifier.ada" }, { "match": "\\.\\.", "name": "keyword.ada" }, { "include": "#access_definition" }, { "include": "#subtype_mark" } ] }, "component_item": { "patterns": [ { "include": "#component_declaration" }, { "include": "#variant_part" }, { "include": "#comment" }, { "include": "#aspect_clause" }, { "captures": { "1": { "name": "keyword.ada" }, "2": { "name": "punctuation.ada" } }, "match": "(?i)\\b(null)\\s*(;)" } ] }, "composite_constraint": { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "name": "meta.declaration.constraint.composite.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\.\\.", "name": "keyword.ada" }, { "captures": { "1": { "name": "variable.name.ada" }, "2": { "name": "keyword.other.ada" }, "3": { "patterns": [ { "include": "#expression" } ] } }, "match": "(?i)\\b([_\\w\\d]+)\\s*(=>)\\s*([^),])+\\b" }, { "include": "#expression" } ] }, "decimal_literal": { "captures": { "1": { "name": "punctuation.ada" }, "2": { "name": "punctuation.radix-point.ada" }, "3": { "name": "punctuation.ada" }, "4": { "patterns": [ { "include": "#exponent_part" } ] } }, "match": "\\d(?:(_)?\\d)*(?:(\\.)\\d(?:(_)?\\d)*)?([Ee][-+]?\\d(?:_?\\d)*)?", "name": "constant.numeric.ada" }, "declarative_item": { "patterns": [ { "include": "#body" }, { "include": "#basic_declarative_item" } ] }, "delay_relative_statement": { "begin": "(?i)\\b(delay)\\b", "beginCaptures": { "1": { "name": "keyword.control.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "patterns": [ { "include": "#expression" } ] }, "delay_statement": { "patterns": [ { "include": "#delay_until_statement" }, { "include": "#delay_relative_statement" } ] }, "delay_until_statement": { "begin": "(?i)\\b(delay)\\s+(until)\\b", "beginCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "keyword.control.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.delay.until.ada", "patterns": [ { "include": "#expression" } ] }, "derived_type_definition": { "name": "meta.declaration.type.definition.derived.ada", "patterns": [ { "begin": "(?i)\\bnew\\b", "beginCaptures": { "0": { "name": "storage.modifier.ada" } }, "end": "(?i)(?=(\\bwith\\b|;))", "patterns": [ { "match": "(?i)\\band\\b", "name": "storage.modifier.ada" }, { "include": "#subtype_mark" } ] }, { "match": "(?i)\\b(abstract|and|limited|tagged)\\b", "name": "storage.modifier.ada" }, { "match": "(?i)\\bprivate\\b", "name": "storage.visibility.ada" }, { "include": "#subtype_mark" } ] }, "discriminant_specification": { "begin": "(?i)\\b([_\\w\\d]+(?:\\s*,\\s*[_\\w\\d]+)?)\\s*(:)", "beginCaptures": { "1": { "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([_\\w\\d])+\\b", "name": "variable.name.ada" } ] }, "2": { "name": "punctuation.ada" } }, "end": "(?=([);]))", "patterns": [ { "begin": ":=", "beginCaptures": { "0": { "name": "keyword.operator.new.ada" } }, "end": "(?=([);]))", "patterns": [ { "include": "#expression" } ] }, { "captures": { "1": { "name": "storage.visibility.ada" }, "2": { "patterns": [ { "include": "#subtype_mark" } ] } }, "match": "(?i)(not\\s+null\\s+)?([._\\w\\d]+)\\b" }, { "include": "#access_definition" } ] }, "entry_body": { "begin": "(?i)\\b(entry)\\s+([_\\w\\d]+)\\b", "beginCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "entity.name.entry.ada" } }, "end": "(?i)\\b(end)\\s*(\\s\\2)\\s*(;)", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "entity.name.entry.ada" }, "3": { "name": "punctuation.ada" } }, "patterns": [ { "begin": "(?i)\\bis\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(?=begin)\\b", "patterns": [ { "include": "#declarative_item" } ] }, { "begin": "(?i)\\bbegin\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(?=end)\\b", "patterns": [ { "include": "#statement" } ] }, { "begin": "(?i)\\bwhen\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(?=is)\\b", "patterns": [ { "include": "#expression" } ] }, { "include": "#parameter_profile" } ] }, "entry_declaration": { "begin": "(?i)\\b(?:(not)?\\s+(overriding)\\s+)?(entry)\\s+([_\\w\\d]+)\\b", "beginCaptures": { "1": { "name": "storage.modifier.ada" }, "2": { "name": "storage.modifier.ada" }, "3": { "name": "keyword.ada" }, "4": { "name": "entity.name.entry.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "patterns": [ { "include": "#parameter_profile" } ] }, "enumeration_type_definition": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.declaration.type.definition.enumeration.ada", "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([_\\w\\d])+\\b", "name": "variable.name.ada" }, { "include": "#comment" } ] }, "exception_declaration": { "begin": "(?i)\\b([_\\w\\d]+(?:\\s*,\\s*[_\\w\\d]+)?)\\s*(:)\\s*(exception)", "beginCaptures": { "1": { "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([_\\w\\d])+\\b", "name": "entity.name.exception.ada" } ] }, "2": { "name": "punctuation.ada" }, "3": { "name": "storage.type.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.declaration.exception.ada", "patterns": [ { "match": "(?i)\\b(renames)\\s+(([._\\w\\d])+)", "name": "entity.name.exception.ada" } ] }, "exit_statement": { "begin": "(?i)\\bexit\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.exit.ada", "patterns": [ { "begin": "(?i)\\bwhen\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?=;)", "patterns": [ { "include": "#expression" } ] }, { "match": "[_\\w\\d]+", "name": "entity.name.label.ada" } ] }, "exponent_part": { "captures": { "1": { "name": "punctuation.exponent-mark.ada" }, "2": { "name": "keyword.operator.unary.ada" }, "3": { "name": "punctuation.ada" } }, "match": "([Ee])([-+])?\\d(?:(_)?\\d)*" }, "expression": { "name": "meta.expression.ada", "patterns": [ { "match": "(?i)\\bnull\\b", "name": "constant.language.ada" }, { "match": "=>(\\+)?", "name": "keyword.other.ada" }, { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "patterns": [ { "include": "#expression" } ] }, { "match": ",", "name": "punctuation.ada" }, { "match": "\\.\\.", "name": "keyword.ada" }, { "include": "#value" }, { "include": "#attribute" }, { "include": "#comment" }, { "include": "#operator" }, { "match": "(?i)\\b(and|or|xor)\\b", "name": "keyword.ada" }, { "match": "(?i)\\b(if|then|else|elsif|in|for|(?<!\\.)all|some|\\.\\.|delta|with)\\b", "name": "keyword.ada" } ] }, "for_loop_statement": { "begin": "(?i)\\bfor\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)\\b(end)\\s+(loop)(\\s+[_\\w\\d]+)?\\s*(;)", "endCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "keyword.control.ada" }, "3": { "name": "entity.name.label.ada" }, "4": { "name": "punctuation.ada" } }, "name": "meta.statement.loop.for.ada", "patterns": [ { "begin": "(?i)(?<=for)", "end": "(?i)\\bloop\\b", "endCaptures": { "0": { "name": "keyword.control.ada" } }, "patterns": [ { "captures": { "1": { "name": "variable.name.ada" }, "2": { "name": "keyword.control.ada" }, "3": { "name": "keyword.control.ada" } }, "match": "(?i)\\b([_\\w\\d]+)\\s+(in)(\\s+reverse)?\\b" }, { "captures": { "1": { "name": "variable.name.ada" }, "2": { "name": "punctuation.ada" }, "3": { "patterns": [ { "include": "#subtype_mark" } ] }, "4": { "name": "keyword.control.ada" }, "5": { "name": "keyword.control.ada" } }, "match": "(?i)\\b([_\\w\\d]+)(?:\\s*(:)\\s*([._\\w\\d]+))?\\s+(of)(\\s+reverse)?\\b" }, { "include": "#expression" } ] }, { "include": "#statement" } ] }, "full_type_declaration": { "patterns": [ { "include": "#task_type_declaration" }, { "include": "#regular_type_declaration" } ] }, "function_body": { "begin": "(?i)\\b(overriding\\s+)?(function)\\s+(?:([._\\w\\d]+)\\b|(\".+\"))", "beginCaptures": { "1": { "name": "storage.visibility.ada" }, "2": { "name": "keyword.ada" }, "3": { "name": "entity.name.function.ada" }, "4": { "patterns": [ { "include": "#string_literal" } ] } }, "end": "(?i)(?:\\b(end)\\s+(\\3|\\4)\\s*)?(;)", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "entity.name.function.ada" }, "3": { "name": "punctuation.ada" } }, "name": "meta.declaration.function.body.ada", "patterns": [ { "begin": "(?i)\\bbegin\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)(?=end)", "patterns": [ { "include": "#handled_sequence_of_statements" } ] }, { "include": "#aspect_specification" }, { "include": "#result_profile" }, { "include": "#subprogram_renaming_declaration" }, { "include": "#parameter_profile" }, { "begin": "(?i)\\bis\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)(?=(with|begin|;))", "name": "meta.function.body.spec_part.ada", "patterns": [ { "begin": "(?i)\\bnew\\b", "beginCaptures": { "0": { "name": "keyword.operator.new.ada" } }, "end": "(?=;)", "name": "meta.declaration.package.generic.ada", "patterns": [ { "match": "([._\\w\\d]+)", "name": "entity.name.function.ada" }, { "include": "#actual_parameter_part" } ] }, { "captures": { "0": { "name": "storage.modifier.ada" } }, "match": "(?i)\\babstract\\b", "name": "meta.declaration.function.abstract.ada" }, { "include": "#declarative_item" }, { "include": "#subprogram_renaming_declaration" }, { "include": "#expression" } ] } ] }, "function_specification": { "patterns": [ { "include": "#function_body" } ] }, "goto_statement": { "begin": "(?i)\\bgoto\\b", "beginCaptures": { "0": { "name": "keyword.control.goto.ada" } }, "end": ";", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.statement.goto.ada", "patterns": [ { } ] }, "guard": { "begin": "(?i)\\bwhen\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "=>", "endCaptures": { "0": { "name": "keyword.other.ada" } }, "patterns": [ { "include": "#expression" } ] }, "handled_sequence_of_statements": { "patterns": [ { "begin": "(?i)\\bexception\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(?=end)\\b", "name": "meta.handler.exception.ada", "patterns": [ { "begin": "(?i)\\bwhen\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "=>", "endCaptures": { "0": { "name": "keyword.other.ada" } }, "patterns": [ { "captures": { "1": { "name": "variable.name.ada" }, "2": { "name": "punctuation.ada" } }, "match": "\\b([._\\w\\d]+)\\s*(:)" }, { "match": "\\|", "name": "punctuation.ada" }, { "match": "(?i)\\bothers\\b", "name": "keyword.ada" }, { "match": "[._\\w\\d]+", "name": "entity.name.exception.ada" } ] }, { "include": "#statement" } ] }, { "include": "#statement" } ] }, "highest_precedence_operator": { "match": "(?i)(\\*\\*|\\babs\\b|\\bnot\\b)", "name": "keyword.operator.highest-precedence.ada" }, "if_statement": { "begin": "(?i)\\bif\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)\\b(end)\\s+(if)\\s*(;)", "endCaptures": { "1": { "name": "keyword.control.ada" }, "2": { "name": "keyword.control.ada" }, "3": { "name": "punctuation.ada" } }, "name": "meta.statement.if.ada", "patterns": [ { "begin": "(?i)\\belsif\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)(?<!\\sand)\\s+(?=then)", "patterns": [ { "include": "#expression" } ] }, { "begin": "(?i)\\belse\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)(?=end)", "patterns": [ { "include": "#statement" } ] }, { "begin": "(?i)(?<=if)\\b", "end": "(?i)(?<!\\sand)\\s+(?=then)", "endCaptures": { "0": { "name": "keyword.control.ada" } }, "patterns": [ { "include": "#expression" } ] }, { "begin": "(?i)\\bthen\\b", "beginCaptures": { "0": { "name": "keyword.control.ada" } }, "end": "(?i)(?=(e(?:lsif|lse|nd)))", "patterns": [ { "include": "#statement" } ] } ] }, "integer_type_definition": { "name": "meta.declaration.type.definition.integer.ada", "patterns": [ { "include": "#signed_integer_type_definition" }, { "include": "#modular_type_definition" } ] }, "interface_type_definition": { "begin": "(?i)\\b(?:(limited|task|protected|synchronized)\\s+)?(interface)", "beginCaptures": { "1": { "name": "storage.modifier.ada" }, "2": { "name": "storage.modifier.ada" } }, "end": "(?i)(?=(with|;))", "name": "meta.declaration.type.definition.interface.ada", "patterns": [ { "match": "(?i)\\band\\b", "name": "storage.modifier.ada" }, { "include": "#subtype_mark" } ] }, "keyword": { "patterns": [ { "match": "(?i)\\b(abort|abs|accept|all|and|at|begin|body|declare|delay|end|entry|exception|function|generic|in|is|mod|new|not|null|of|or|others|out|package|pragma|procedure|range|record|rem|renames|requeue|reverse|select|separate|some|subtype|then|type|use|when|with|xor)\\b", "name": "keyword.ada" }, { "match": "(?i)\\b(case|do|else|elsif|exit|for|goto|if|loop|raise|return|terminate|until|while)\\b", "name": "keyword.control.ada" }, { "match": "(?i)\\b(abstract|access|aliased|array|constant|delta|digits|interface|limited|protected|synchronized|tagged|task)\\b", "name": "storage.modifier.ada" }, { "match": "(?i)\\b(private|overriding)\\b", "name": "storage.visibility.ada" }, { "match": "<>", "name": "keyword.modifier.unknown.ada" }, { "match": "([-*+/])", "name": "keyword.operator.arithmetic.ada" }, { "match": ":=", "name": "keyword.operator.assignment.ada" }, { "match": "(=|/=|[<>]|<=|>=)", "name": "keyword.operator.logic.ada" }, { "match": "&", "name": "keyword.operator.concatenation.ada" } ] }, "known_discriminant_part": { "begin": "\\(", "captures": { "0": { "name": "punctuation.ada" } }, "end": "\\)", "name": "meta.declaration.type.discriminant.ada", "patterns": [ { "match": ";", "name": "punctuation.ada" }, { "include": "#discriminant_specification" } ] }, "label": { "captures": { "1": { "name": "punctuation.label.ada" }, "2": { "name": "entity.name.label.ada" }, "3": { "name": "punctuation.label.ada" } }, "match": "(<<)?([_\\w\\d]+)\\s*(:[^=]|>>)", "name": "meta.label.ada" }, "library_unit": { "name": "meta.library.unit.ada", "patterns": [ { "include": "#package_body" }, { "include": "#package_specification" }, { "include": "#subprogram_body" } ] }, "loop_statement": { "patterns": [ { "include": "#simple_loop_statement" }, { "include": "#while_loop_statement" }, { "include": "#for_loop_statement" } ] }, "modular_type_definition": { "begin": "(?i)\\b(mod)\\b", "beginCaptures": { "1": { "name": "storage.modifier.ada" } }, "end": "(?i)(?=(with|;))", "patterns": [ { "match": "<>", "name": "keyword.modifier.unknown.ada" }, { "include": "#expression" } ] }, "multiplying_operator": { "match": "(?i)([*/]|\\bmod\\b|\\brem\\b)", "name": "keyword.operator.multiplying.ada" }, "null_statement": { "captures": { "1": { "name": "keyword.ada" }, "2": { "name": "punctuation.ada" } }, "match": "(?i)\\b(null)\\s*(;)", "name": "meta.statement.null.ada" }, "object_declaration": { "begin": "(?i)\\b([_\\w\\d]+(?:\\s*,\\s*[_\\w\\d]+)*)\\s*(:)", "beginCaptures": { "1": { "patterns": [ { "match": ",", "name": "punctuation.ada" }, { "match": "\\b([_\\w\\d])+\\b", "name": "variable.name.ada" } ] }, "2": { "name": "punctuation.ada" } }, "end": "(;)", "endCaptures": { "0": { "name": "punctuation.ada" } }, "name": "meta.declaration.object.ada", "patterns": [ { "begin": "(?<=:)", "end": "(?=;)|(:=)|\\b(renames)\\b", "endCaptures": { "1": { "name": "keyword.operator.new.ada" }, "2": { "name": "keyword.ada" } }, "patterns": [ { "match": "(?i)\\bconstant\\b", "name": "storage.modifier.ada" }, { "match": "(?i)\\baliased\\b", "name": "storage.visibility.ada" }, { "include": "#aspect_specification" }, { "include": "#subtype_mark" } ] }, { "begin": "(?<=:=)", "end": "(?=;)", "patterns": [ { "include": "#aspect_specification" }, { "include": "#expression" } ] }, { "begin": "(?<=renames)", "end": "(?=;)", "patterns": [ { "include": "#aspect_specification" } ] } ] }, "operator": { "patterns": [ { "include": "#highest_precedence_operator" }, { "include": "#multiplying_operator" }, { "include": "#adding_operator" }, { "include": "#relational_operator" }, { "include": "#logical_operator" } ] }, "package_body": { "begin": "(?i)\\b(package)\\s+(body)\\s+([._\\w\\d]+)\\b", "beginCaptures": { "1": { "name": "keyword.ada" }, "2": { "name": "keyword.ada" }, "3": { "patterns": [ { "include": "#package_mark" } ] } }, "end": "(?i)\\b(end)\\s+(\\3)\\s*(;)", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "patterns": [ { "include": "#package_mark" } ] }, "3": { "name": "punctuation.ada" } }, "name": "meta.declaration.package.body.ada", "patterns": [ { "begin": "(?i)\\bbegin\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)\\b(?=end)\\b", "patterns": [ { "include": "#handled_sequence_of_statements" } ] }, { "begin": "(?i)\\bis\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?i)(?=\\b(begin|end)\\b)", "patterns": [ { "match": "(?i)\\bprivate\\b", "name": "keyword.ada" }, { "include": "#declarative_item" }, { "include": "#comment" } ] }, { "include": "#aspect_specification" } ] }, "package_declaration": { "patterns": [ { "include": "#package_specification" } ] }, "package_mark": { "match": "\\b([._\\w\\d])+\\b", "name": "entity.name.package.ada" }, "package_specification": { "begin": "(?i)\\b(package)\\s+([._\\w\\d]+)\\b", "beginCaptures": { "1": { "name": "keyword.ada" }, "2": { "patterns": [ { "include": "#package_mark" } ] } }, "end": "(?i)(?:\\b(end)\\s+(\\2)\\s*)?(;)", "endCaptures": { "1": { "name": "keyword.ada" }, "2": { "patterns": [ { "include": "#package_mark" } ] }, "3": { "name": "punctuation.ada" } }, "name": "meta.declaration.package.specification.ada", "patterns": [ { "begin": "(?i)\\bis\\b", "beginCaptures": { "0": { "name": "keyword.ada" } }, "end": "(?=(end|;))", "patterns": [ { "begin": "(?i)\\bnew\\b", "beginCaptures": { "0": { "name": "keyword.operator.new.ada" } }, "end": "(?=;)", "name": "meta.declaration.package.generic.ada", "patterns": [ { "include": "#package_mark" }, { "include": "#actual_parameter_part" } ] }, {