Skip to content

Commit 6b0d2ab

Browse files
committed
Merge preproc_def and preproc_function_def
1 parent 813d49d commit 6b0d2ab

File tree

5 files changed

+715921
-728361
lines changed

5 files changed

+715921
-728361
lines changed

grammar.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ module.exports = grammar({
138138
$.preproc_ifdef,
139139
$.preproc_include,
140140
$.preproc_def,
141-
$.preproc_function_def,
142141
$.preproc_call,
143142
)),
144143

@@ -162,14 +161,6 @@ module.exports = grammar({
162161
token(prec(1, /\r?\n/)), // force newline to win over preproc_arg
163162
),
164163

165-
preproc_function_def: $ => seq(
166-
preprocessor('define'),
167-
field('name', $.identifier),
168-
field('parameters', $.preproc_params),
169-
field('value', optional($.preproc_arg)),
170-
token.immediate(/\r?\n/),
171-
),
172-
173164
preproc_params: $ => seq(
174165
token.immediate('('), commaSep(choice($.identifier, '...')), ')',
175166
),
@@ -367,7 +358,6 @@ module.exports = grammar({
367358
$.include_statement,
368359
$.preproc_include,
369360
$.preproc_def,
370-
$.preproc_function_def,
371361
$.preproc_call,
372362
alias($.preproc_if_in_interface, $.preproc_if),
373363
alias($.preproc_ifdef_in_interface, $.preproc_ifdef),
@@ -559,7 +549,6 @@ module.exports = grammar({
559549
alias($.preproc_ifdef_in_internal_procedures, $.preproc_ifdef),
560550
$.preproc_include,
561551
$.preproc_def,
562-
$.preproc_function_def,
563552
$.preproc_call,
564553
),
565554

@@ -577,7 +566,6 @@ module.exports = grammar({
577566
prec(1, seq($.statement_label, $.format_statement, $.end_of_statement)),
578567
$.preproc_include,
579568
$.preproc_def,
580-
$.preproc_function_def,
581569
$.preproc_call,
582570
alias($.preproc_if_in_specification_part, $.preproc_if),
583571
alias($.preproc_ifdef_in_specification_part, $.preproc_ifdef),
@@ -760,7 +748,6 @@ module.exports = grammar({
760748
seq($.variable_declaration, $.end_of_statement),
761749
$.preproc_include,
762750
$.preproc_def,
763-
$.preproc_function_def,
764751
$.preproc_call,
765752
alias($.preproc_if_in_derived_type, $.preproc_if),
766753
alias($.preproc_ifdef_in_derived_type, $.preproc_ifdef),
@@ -1135,7 +1122,6 @@ module.exports = grammar({
11351122
alias($.preproc_ifdef_in_statements, $.preproc_ifdef),
11361123
$.preproc_include,
11371124
$.preproc_def,
1138-
$.preproc_function_def,
11391125
$.preproc_call,
11401126
seq(
11411127
optional($.statement_label),
@@ -1529,7 +1515,6 @@ module.exports = grammar({
15291515
$.case_statement,
15301516
$.preproc_include,
15311517
$.preproc_def,
1532-
$.preproc_function_def,
15331518
$.preproc_call,
15341519
alias($.preproc_if_in_select_case, $.preproc_if),
15351520
alias($.preproc_ifdef_in_select_case, $.preproc_ifdef),
@@ -1547,7 +1532,6 @@ module.exports = grammar({
15471532
$.type_statement,
15481533
$.preproc_include,
15491534
$.preproc_def,
1550-
$.preproc_function_def,
15511535
$.preproc_call,
15521536
alias($.preproc_if_in_select_type, $.preproc_if),
15531537
alias($.preproc_ifdef_in_select_type, $.preproc_ifdef),
@@ -1565,7 +1549,6 @@ module.exports = grammar({
15651549
$.rank_statement,
15661550
$.preproc_include,
15671551
$.preproc_def,
1568-
$.preproc_function_def,
15691552
$.preproc_call,
15701553
alias($.preproc_if_in_select_rank, $.preproc_if),
15711554
alias($.preproc_ifdef_in_select_rank, $.preproc_ifdef),

src/grammar.json

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@
8080
"type": "SYMBOL",
8181
"name": "preproc_def"
8282
},
83-
{
84-
"type": "SYMBOL",
85-
"name": "preproc_function_def"
86-
},
8783
{
8884
"type": "SYMBOL",
8985
"name": "preproc_call"
@@ -188,59 +184,6 @@
188184
}
189185
]
190186
},
191-
"preproc_function_def": {
192-
"type": "SEQ",
193-
"members": [
194-
{
195-
"type": "ALIAS",
196-
"content": {
197-
"type": "PATTERN",
198-
"value": "#[ \t]*define"
199-
},
200-
"named": false,
201-
"value": "#define"
202-
},
203-
{
204-
"type": "FIELD",
205-
"name": "name",
206-
"content": {
207-
"type": "SYMBOL",
208-
"name": "identifier"
209-
}
210-
},
211-
{
212-
"type": "FIELD",
213-
"name": "parameters",
214-
"content": {
215-
"type": "SYMBOL",
216-
"name": "preproc_params"
217-
}
218-
},
219-
{
220-
"type": "FIELD",
221-
"name": "value",
222-
"content": {
223-
"type": "CHOICE",
224-
"members": [
225-
{
226-
"type": "SYMBOL",
227-
"name": "preproc_arg"
228-
},
229-
{
230-
"type": "BLANK"
231-
}
232-
]
233-
}
234-
},
235-
{
236-
"type": "IMMEDIATE_TOKEN",
237-
"content": {
238-
"type": "PATTERN",
239-
"value": "\\r?\\n"
240-
}
241-
}
242-
]
243-
},
244187
"preproc_params": {
245188
"type": "SEQ",
246189
"members": [
@@ -8579,10 +8522,6 @@
85798522
"type": "SYMBOL",
85808523
"name": "preproc_def"
85818524
},
8582-
{
8583-
"type": "SYMBOL",
8584-
"name": "preproc_function_def"
8585-
},
85868525
{
85878526
"type": "SYMBOL",
85888527
"name": "preproc_call"
@@ -10123,10 +10062,6 @@
1012310062
"type": "SYMBOL",
1012410063
"name": "preproc_def"
1012510064
},
10126-
{
10127-
"type": "SYMBOL",
10128-
"name": "preproc_function_def"
10129-
},
1013010065
{
1013110066
"type": "SYMBOL",
1013210067
"name": "preproc_call"
@@ -10189,10 +10124,6 @@
1018910124
"type": "SYMBOL",
1019010125
"name": "preproc_def"
1019110126
},
10192-
{
10193-
"type": "SYMBOL",
10194-
"name": "preproc_function_def"
10195-
},
1019610127
{
1019710128
"type": "SYMBOL",
1019810129
"name": "preproc_call"
@@ -11459,10 +11390,6 @@
1145911390
"type": "SYMBOL",
1146011391
"name": "preproc_def"
1146111392
},
11462-
{
11463-
"type": "SYMBOL",
11464-
"name": "preproc_function_def"
11465-
},
1146611393
{
1146711394
"type": "SYMBOL",
1146811395
"name": "preproc_call"
@@ -13986,10 +13913,6 @@
1398613913
"type": "SYMBOL",
1398713914
"name": "preproc_def"
1398813915
},
13989-
{
13990-
"type": "SYMBOL",
13991-
"name": "preproc_function_def"
13992-
},
1399313916
{
1399413917
"type": "SYMBOL",
1399513918
"name": "preproc_call"
@@ -16500,10 +16423,6 @@
1650016423
"type": "SYMBOL",
1650116424
"name": "preproc_def"
1650216425
},
16503-
{
16504-
"type": "SYMBOL",
16505-
"name": "preproc_function_def"
16506-
},
1650716426
{
1650816427
"type": "SYMBOL",
1650916428
"name": "preproc_call"
@@ -16624,10 +16543,6 @@
1662416543
"type": "SYMBOL",
1662516544
"name": "preproc_def"
1662616545
},
16627-
{
16628-
"type": "SYMBOL",
16629-
"name": "preproc_function_def"
16630-
},
1663116546
{
1663216547
"type": "SYMBOL",
1663316548
"name": "preproc_call"
@@ -16748,10 +16663,6 @@
1674816663
"type": "SYMBOL",
1674916664
"name": "preproc_def"
1675016665
},
16751-
{
16752-
"type": "SYMBOL",
16753-
"name": "preproc_function_def"
16754-
},
1675516666
{
1675616667
"type": "SYMBOL",
1675716668
"name": "preproc_call"

0 commit comments

Comments
 (0)