Skip to content

Commit 6be7dde

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

File tree

5 files changed

+715921
-728432
lines changed

5 files changed

+715921
-728432
lines changed

grammar.js

Lines changed: 0 additions & 21 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,18 +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-
173-
preproc_params: $ => seq(
174-
token.immediate('('), commaSep(choice($.identifier, '...')), ')',
175-
),
176-
177164
preproc_call: $ => seq(
178165
field('directive', $.preproc_directive),
179166
field('argument', optional($.preproc_arg)),
@@ -367,7 +354,6 @@ module.exports = grammar({
367354
$.include_statement,
368355
$.preproc_include,
369356
$.preproc_def,
370-
$.preproc_function_def,
371357
$.preproc_call,
372358
alias($.preproc_if_in_interface, $.preproc_if),
373359
alias($.preproc_ifdef_in_interface, $.preproc_ifdef),
@@ -559,7 +545,6 @@ module.exports = grammar({
559545
alias($.preproc_ifdef_in_internal_procedures, $.preproc_ifdef),
560546
$.preproc_include,
561547
$.preproc_def,
562-
$.preproc_function_def,
563548
$.preproc_call,
564549
),
565550

@@ -577,7 +562,6 @@ module.exports = grammar({
577562
prec(1, seq($.statement_label, $.format_statement, $.end_of_statement)),
578563
$.preproc_include,
579564
$.preproc_def,
580-
$.preproc_function_def,
581565
$.preproc_call,
582566
alias($.preproc_if_in_specification_part, $.preproc_if),
583567
alias($.preproc_ifdef_in_specification_part, $.preproc_ifdef),
@@ -760,7 +744,6 @@ module.exports = grammar({
760744
seq($.variable_declaration, $.end_of_statement),
761745
$.preproc_include,
762746
$.preproc_def,
763-
$.preproc_function_def,
764747
$.preproc_call,
765748
alias($.preproc_if_in_derived_type, $.preproc_if),
766749
alias($.preproc_ifdef_in_derived_type, $.preproc_ifdef),
@@ -1135,7 +1118,6 @@ module.exports = grammar({
11351118
alias($.preproc_ifdef_in_statements, $.preproc_ifdef),
11361119
$.preproc_include,
11371120
$.preproc_def,
1138-
$.preproc_function_def,
11391121
$.preproc_call,
11401122
seq(
11411123
optional($.statement_label),
@@ -1529,7 +1511,6 @@ module.exports = grammar({
15291511
$.case_statement,
15301512
$.preproc_include,
15311513
$.preproc_def,
1532-
$.preproc_function_def,
15331514
$.preproc_call,
15341515
alias($.preproc_if_in_select_case, $.preproc_if),
15351516
alias($.preproc_ifdef_in_select_case, $.preproc_ifdef),
@@ -1547,7 +1528,6 @@ module.exports = grammar({
15471528
$.type_statement,
15481529
$.preproc_include,
15491530
$.preproc_def,
1550-
$.preproc_function_def,
15511531
$.preproc_call,
15521532
alias($.preproc_if_in_select_type, $.preproc_if),
15531533
alias($.preproc_ifdef_in_select_type, $.preproc_ifdef),
@@ -1565,7 +1545,6 @@ module.exports = grammar({
15651545
$.rank_statement,
15661546
$.preproc_include,
15671547
$.preproc_def,
1568-
$.preproc_function_def,
15691548
$.preproc_call,
15701549
alias($.preproc_if_in_select_rank, $.preproc_if),
15711550
alias($.preproc_ifdef_in_select_rank, $.preproc_ifdef),

src/grammar.json

Lines changed: 0 additions & 156 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,126 +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-
},
244-
"preproc_params": {
245-
"type": "SEQ",
246-
"members": [
247-
{
248-
"type": "IMMEDIATE_TOKEN",
249-
"content": {
250-
"type": "STRING",
251-
"value": "("
252-
}
253-
},
254-
{
255-
"type": "CHOICE",
256-
"members": [
257-
{
258-
"type": "SEQ",
259-
"members": [
260-
{
261-
"type": "CHOICE",
262-
"members": [
263-
{
264-
"type": "SYMBOL",
265-
"name": "identifier"
266-
},
267-
{
268-
"type": "STRING",
269-
"value": "..."
270-
}
271-
]
272-
},
273-
{
274-
"type": "REPEAT",
275-
"content": {
276-
"type": "SEQ",
277-
"members": [
278-
{
279-
"type": "STRING",
280-
"value": ","
281-
},
282-
{
283-
"type": "CHOICE",
284-
"members": [
285-
{
286-
"type": "SYMBOL",
287-
"name": "identifier"
288-
},
289-
{
290-
"type": "STRING",
291-
"value": "..."
292-
}
293-
]
294-
}
295-
]
296-
}
297-
}
298-
]
299-
},
300-
{
301-
"type": "BLANK"
302-
}
303-
]
304-
},
305-
{
306-
"type": "STRING",
307-
"value": ")"
308-
}
309-
]
310-
},
311187
"preproc_call": {
312188
"type": "SEQ",
313189
"members": [
@@ -8579,10 +8455,6 @@
85798455
"type": "SYMBOL",
85808456
"name": "preproc_def"
85818457
},
8582-
{
8583-
"type": "SYMBOL",
8584-
"name": "preproc_function_def"
8585-
},
85868458
{
85878459
"type": "SYMBOL",
85888460
"name": "preproc_call"
@@ -10123,10 +9995,6 @@
101239995
"type": "SYMBOL",
101249996
"name": "preproc_def"
101259997
},
10126-
{
10127-
"type": "SYMBOL",
10128-
"name": "preproc_function_def"
10129-
},
101309998
{
101319999
"type": "SYMBOL",
1013210000
"name": "preproc_call"
@@ -10189,10 +10057,6 @@
1018910057
"type": "SYMBOL",
1019010058
"name": "preproc_def"
1019110059
},
10192-
{
10193-
"type": "SYMBOL",
10194-
"name": "preproc_function_def"
10195-
},
1019610060
{
1019710061
"type": "SYMBOL",
1019810062
"name": "preproc_call"
@@ -11459,10 +11323,6 @@
1145911323
"type": "SYMBOL",
1146011324
"name": "preproc_def"
1146111325
},
11462-
{
11463-
"type": "SYMBOL",
11464-
"name": "preproc_function_def"
11465-
},
1146611326
{
1146711327
"type": "SYMBOL",
1146811328
"name": "preproc_call"
@@ -13986,10 +13846,6 @@
1398613846
"type": "SYMBOL",
1398713847
"name": "preproc_def"
1398813848
},
13989-
{
13990-
"type": "SYMBOL",
13991-
"name": "preproc_function_def"
13992-
},
1399313849
{
1399413850
"type": "SYMBOL",
1399513851
"name": "preproc_call"
@@ -16500,10 +16356,6 @@
1650016356
"type": "SYMBOL",
1650116357
"name": "preproc_def"
1650216358
},
16503-
{
16504-
"type": "SYMBOL",
16505-
"name": "preproc_function_def"
16506-
},
1650716359
{
1650816360
"type": "SYMBOL",
1650916361
"name": "preproc_call"
@@ -16624,10 +16476,6 @@
1662416476
"type": "SYMBOL",
1662516477
"name": "preproc_def"
1662616478
},
16627-
{
16628-
"type": "SYMBOL",
16629-
"name": "preproc_function_def"
16630-
},
1663116479
{
1663216480
"type": "SYMBOL",
1663316481
"name": "preproc_call"
@@ -16748,10 +16596,6 @@
1674816596
"type": "SYMBOL",
1674916597
"name": "preproc_def"
1675016598
},
16751-
{
16752-
"type": "SYMBOL",
16753-
"name": "preproc_function_def"
16754-
},
1675516599
{
1675616600
"type": "SYMBOL",
1675716601
"name": "preproc_call"

0 commit comments

Comments
 (0)