diff --git a/unified/extractor/tree-sitter-swift/grammar.js b/unified/extractor/tree-sitter-swift/grammar.js index 13248b67778..45b037428bb 100644 --- a/unified/extractor/tree-sitter-swift/grammar.js +++ b/unified/extractor/tree-sitter-swift/grammar.js @@ -1818,7 +1818,7 @@ module.exports = grammar({ ), // The Swift compiler no longer accepts these, but some very old code still uses it. deprecated_operator_declaration_body: ($) => - seq("{", repeat(choice($.simple_identifier, $._basic_literal)), "}"), + seq("{", repeat(field("entry", choice($.simple_identifier, $._basic_literal))), "}"), precedence_group_declaration: ($) => seq( "precedencegroup", diff --git a/unified/extractor/tree-sitter-swift/node-types.yml b/unified/extractor/tree-sitter-swift/node-types.yml index cd9ae864e6b..1a101c09563 100644 --- a/unified/extractor/tree-sitter-swift/node-types.yml +++ b/unified/extractor/tree-sitter-swift/node-types.yml @@ -229,7 +229,7 @@ named: body: function_body modifiers?: modifiers deprecated_operator_declaration_body: - $children*: [bin_literal, boolean_literal, hex_literal, integer_literal, line_string_literal, multi_line_string_literal, oct_literal, raw_string_literal, real_literal, regex_literal, simple_identifier] + entry*: [bin_literal, boolean_literal, hex_literal, integer_literal, line_string_literal, multi_line_string_literal, "nil", oct_literal, raw_string_literal, real_literal, regex_literal, simple_identifier] diagnostic: dictionary_literal: key*: expression