mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:40:12 +01:00
@@ -151,7 +151,7 @@ module.exports = grammar({
|
||||
$.struct_type_literal
|
||||
),
|
||||
|
||||
_binding_lhs: ($) => choice($.ident, '_'),
|
||||
binding_lhs: ($) => choice($.ident, '_'),
|
||||
|
||||
paren_pattern: ($) =>
|
||||
seq(
|
||||
@@ -163,9 +163,9 @@ module.exports = grammar({
|
||||
_pattern_without_expression: ($) =>
|
||||
choice(
|
||||
'auto',
|
||||
seq($._binding_lhs, ':', $._expression),
|
||||
seq($._binding_lhs, ':!', $._expression),
|
||||
seq('template', $._binding_lhs, ':!', $._expression),
|
||||
seq($.binding_lhs, ':', $._expression),
|
||||
seq($.binding_lhs, ':!', $._expression),
|
||||
seq('template', $.binding_lhs, ':!', $._expression),
|
||||
seq('var', $._pattern),
|
||||
$.paren_pattern,
|
||||
// alternative patterns
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
(function_declaration (declared_name (ident) @function))
|
||||
(call_expression (ident) @function)
|
||||
|
||||
; TODO: add more specific rules
|
||||
(namespace_declaration (declared_name) @namespace)
|
||||
(interface_declaration (declared_name) @type)
|
||||
(constraint_declaration (declared_name) @type)
|
||||
(class_declaration (declared_name) @type)
|
||||
(choice_declaration (declared_name) @type)
|
||||
(binding_lhs) @variable
|
||||
|
||||
; upper case => type
|
||||
((ident) @type
|
||||
|
||||
Reference in New Issue
Block a user