Skip to content

Commit a4c9b54

Browse files
committed
Hiding useless rules
1 parent 11fa2a7 commit a4c9b54

18 files changed

+851762
-853485
lines changed

grammar.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ module.exports = grammar(CPP1, {
123123
[$.raw_string_literal, $.cpp2_raw_string_literal],
124124

125125
// Cpp2
126-
[$.cpp2_no_namespace_identifier, $.cpp2_template_identifier],
126+
[$._cpp2_no_namespace_identifier, $._cpp2_template_identifier],
127127
[$.cpp2_unary_postfix_expression, $.cpp2_binary_expression],
128128
[$.cpp2_unary_prefix_expression, $.cpp2_binary_expression],
129129
[$.cpp2_block_loop, $.cpp2_do_while_statement],
130130
[$._cpp2_declaration_left_side, $.cpp2_non_block_loop, $.cpp2_block_loop],
131131
[$._cpp2_declaration_left_side, $.cpp2_block_loop],
132132
[$.cpp2_type, $.cpp2_unary_postfix_expression, $.cpp2_binary_expression],
133-
[$._cpp2_declaration_left_side, $.cpp2_no_namespace_identifier],
133+
[$._cpp2_declaration_left_side, $._cpp2_no_namespace_identifier],
134134
[$.cpp2_ordinary_identifier, $.cpp2_passing_style],
135135
[$.cpp2_passing_style],
136136
[$.cpp2_function_declaration_argument, $.cpp2_expression],
@@ -534,19 +534,19 @@ module.exports = grammar(CPP1, {
534534
field(
535535
"namespaces",
536536
seq(
537-
choice(seq($.cpp2_no_namespace_identifier, "::"), " ::"),
538-
repeat(seq($.cpp2_no_namespace_identifier, "::")),
537+
choice(seq($._cpp2_no_namespace_identifier, "::"), " ::"),
538+
repeat(seq($._cpp2_no_namespace_identifier, "::")),
539539
),
540540
),
541541
),
542-
field("last", $.cpp2_no_namespace_identifier),
542+
field("last", $._cpp2_no_namespace_identifier),
543543
),
544544
),
545545

546-
cpp2_no_namespace_identifier: ($) =>
547-
choice($.cpp2_non_template_identifier, $.cpp2_template_identifier),
546+
_cpp2_no_namespace_identifier: ($) =>
547+
choice($.cpp2_non_template_identifier, $._cpp2_template_identifier),
548548

549-
cpp2_template_identifier: ($) =>
549+
_cpp2_template_identifier: ($) =>
550550
seq($.cpp2_non_template_identifier, $.cpp2_template_call_arguments),
551551

552552
cpp2_non_template_identifier: ($) =>

queries/highlights.scm

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@
9191

9292
(cpp2_function_declaration_argument
9393
(cpp2_any_identifier
94-
last: (cpp2_no_namespace_identifier
95-
(cpp2_non_template_identifier) @emphasis)))
94+
last: (cpp2_non_template_identifier) @emphasis))
9695

9796
(cpp2_function_declaration_argument
9897
(cpp2_expression_declaration
@@ -109,40 +108,17 @@
109108
(cpp2_no_definition_declaration
110109
type: (cpp2_expression
111110
(cpp2_any_identifier
112-
last: (cpp2_no_namespace_identifier
113-
(cpp2_template_identifier
114-
(cpp2_non_template_identifier) @type)))))
115-
116-
(cpp2_no_definition_declaration
117-
type: (cpp2_expression
118-
(cpp2_any_identifier
119-
last: (cpp2_no_namespace_identifier) @type)))
120-
121-
(cpp2_left_side_of_definition
122-
type: (cpp2_expression
123-
(cpp2_any_identifier
124-
last: (cpp2_no_namespace_identifier
125-
(cpp2_template_identifier
126-
(cpp2_non_template_identifier) @type)))))
111+
last: (cpp2_non_template_identifier) @type)))
127112

128113
(cpp2_left_side_of_definition
129114
type: (cpp2_expression
130115
(cpp2_any_identifier
131-
last: (cpp2_no_namespace_identifier
132-
(cpp2_non_template_identifier) @type))))
116+
last: (cpp2_non_template_identifier) @type)))
133117

134118
(cpp2_function_type
135119
return: (cpp2_expression
136120
(cpp2_any_identifier
137-
last: (cpp2_no_namespace_identifier
138-
(cpp2_template_identifier
139-
(cpp2_non_template_identifier) @type)))))
140-
141-
(cpp2_function_type
142-
return: (cpp2_expression
143-
(cpp2_any_identifier
144-
last: (cpp2_no_namespace_identifier
145-
(cpp2_non_template_identifier) @type))))
121+
last: (cpp2_non_template_identifier) @type)))
146122

147123
(cpp2_next) @keyword
148124

@@ -157,16 +133,8 @@
157133
(cpp2_function_call
158134
function: (cpp2_expression
159135
(cpp2_any_identifier
160-
last: (cpp2_no_namespace_identifier
161-
(cpp2_non_template_identifier) @function))))
162-
163-
(cpp2_function_call
164-
function: (cpp2_expression
165-
(cpp2_any_identifier
166-
last: (cpp2_no_namespace_identifier
167-
(cpp2_template_identifier
168-
(cpp2_non_template_identifier) @function)))))
136+
last: (cpp2_non_template_identifier) @function)))
169137

170138
(cpp2_dot_access
171139
field: (cpp2_any_identifier
172-
last: (cpp2_no_namespace_identifier) @property))
140+
last: (cpp2_non_template_identifier) @property))

src/grammar.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)