Skip to content

Commit 4a378dc

Browse files
committed
Update upstream patches
- Patch #3 did not pass the internal testsuite - Patches #20 and stadelmanma#22 were merged together
1 parent 640d956 commit 4a378dc

6 files changed

+37
-41
lines changed

codee/patches/0003-Add-semantic-accessors.patch

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Subject: Add semantic accessors
99
test/corpus/expressions.txt | 6 +++---
1010
test/corpus/preprocessor.txt | 8 ++++----
1111
test/corpus/regressions.txt | 2 +-
12-
test/corpus/statements.txt | 8 ++++----
13-
6 files changed, 35 insertions(+), 22 deletions(-)
12+
test/corpus/statements.txt | 10 +++++-----
13+
6 files changed, 36 insertions(+), 23 deletions(-)
1414

1515
diff --git a/grammar.js b/grammar.js
1616
index 4e6a7f1..d0af7b9 100644
@@ -198,7 +198,7 @@ index fc47bf1..1af946a 100644
198198
left: (call_expression
199199
(identifier)
200200
diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt
201-
index ca8c86e..ad47d68 100644
201+
index ca8c86e..d6bebae 100644
202202
--- a/test/corpus/statements.txt
203203
+++ b/test/corpus/statements.txt
204204
@@ -289,7 +289,7 @@ END PROGRAM
@@ -237,3 +237,12 @@ index ca8c86e..ad47d68 100644
237237
(allocate_statement
238238
allocation: (sized_allocation
239239
(identifier)
240+
@@ -3499,7 +3499,7 @@ end program
241+
(translation_unit
242+
(program
243+
(program_statement
244+
- (name))
245+
+ name: (name))
246+
(implicit_statement
247+
(none))
248+
(variable_declaration

codee/patches/0004-Unhide-end_of_statement.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3918,7 +3918,7 @@ index 1af946a..d6b3f37 100644
39183918
+ (name)
39193919
+ (end_of_statement))))
39203920
diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt
3921-
index ad47d68..fe7ec84 100644
3921+
index d6bebae..fe7ec84 100644
39223922
--- a/test/corpus/statements.txt
39233923
+++ b/test/corpus/statements.txt
39243924
@@ -34,57 +34,76 @@ end subroutine foo
@@ -6818,7 +6818,7 @@ index ad47d68..fe7ec84 100644
68186818
(translation_unit
68196819
(program
68206820
(program_statement
6821-
- (name))
6821+
- name: (name))
68226822
+ name: (name)
68236823
+ (end_of_statement))
68246824
(implicit_statement
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Diego Alonso <diego.alonso@appentra.com>
33
Date: Thu, 26 Jun 2025 14:04:51 +0200
4-
Subject: Allow to parse macro identifiers in variable decls
4+
Subject: Allow to parse macro identifiers
55

66
---
7-
grammar.js | 2 +
7+
grammar.js | 4 ++
88
src/scanner.c | 141 +++++++++++++++++++++++++++++++++++++++++---------
9-
2 files changed, 119 insertions(+), 24 deletions(-)
9+
2 files changed, 121 insertions(+), 24 deletions(-)
1010

1111
diff --git a/grammar.js b/grammar.js
12-
index 6e79004..40ac8b7 100644
12+
index 6e79004..1215588 100644
1313
--- a/grammar.js
1414
+++ b/grammar.js
1515
@@ -67,6 +67,7 @@ module.exports = grammar({
@@ -28,6 +28,22 @@ index 6e79004..40ac8b7 100644
2828
)),
2929
optional(seq(',',
3030
commaSep1(
31+
@@ -1178,6 +1180,7 @@ module.exports = grammar({
32+
// Not strictly valid, but can catch extensions and preprocessor macros
33+
$.call_expression,
34+
$.include_statement,
35+
+ $.macro_identifier
36+
),
37+
38+
statement_label: $ => prec(1, alias($._integer_literal, 'statement_label')),
39+
@@ -1941,6 +1944,7 @@ module.exports = grammar({
40+
$.implied_do_loop_expression,
41+
$.coarray_expression,
42+
$.conditional_expression,
43+
+ $.macro_identifier
44+
),
45+
46+
parenthesized_expression: $ => seq(
3147
diff --git a/src/scanner.c b/src/scanner.c
3248
index b768d99..e5a37ee 100644
3349
--- a/src/scanner.c

codee/patches/0021-Parse-multiline-preprocessor-comments.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Subject: Parse multiline preprocessor comments
99
2 files changed, 79 insertions(+), 10 deletions(-)
1010

1111
diff --git a/grammar.js b/grammar.js
12-
index 40ac8b7..b5c11d1 100644
12+
index 1215588..c6ffa3b 100644
1313
--- a/grammar.js
1414
+++ b/grammar.js
1515
@@ -75,6 +75,7 @@ module.exports = grammar({
@@ -30,7 +30,7 @@ index 40ac8b7..b5c11d1 100644
3030

3131
preproc_binary_expression: $ => {
3232
const table = [
33-
@@ -2466,36 +2468,50 @@ function preprocIf(suffix, content, precedence = 0) {
33+
@@ -2468,36 +2470,50 @@ function preprocIf(suffix, content, precedence = 0) {
3434
);
3535
}
3636

@@ -87,7 +87,7 @@ index 40ac8b7..b5c11d1 100644
8787
field('condition', $._preproc_expression),
8888
field('content', content($)),
8989
field('alternative', optional(alternativeBlock($))),
90-
@@ -2504,7 +2520,7 @@ function preprocIf(suffix, content, precedence = 0) {
90+
@@ -2506,7 +2522,7 @@ function preprocIf(suffix, content, precedence = 0) {
9191
['preproc_elifdef' + suffix]: $ => prec(precedence, seq(
9292
choice(preprocessor('elifdef'), preprocessor('elifndef')),
9393
field('name', $.identifier),

codee/patches/0022-Allow-parse-macro-names-in-statements-and-expression.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)