Skip to content

Commit 4a97544

Browse files
committed
Update existing patches
Reapplying the patches revealed some changes that were not saved in the patches. I must have somehow messed it up
1 parent cdef699 commit 4a97544

7 files changed

Lines changed: 74 additions & 116 deletions

codee/patches/0005-Consume-end_of_statement.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ they can also be consumed as `comment` tokens).
1313
1 file changed, 4 insertions(+), 4 deletions(-)
1414

1515
diff --git a/src/scanner.c b/src/scanner.c
16-
index 188fa2b..66f3fc9 100644
16+
index b11f0b2..846a5d8 100644
1717
--- a/src/scanner.c
1818
+++ b/src/scanner.c
1919
@@ -288,7 +288,7 @@ static bool scan_end_of_statement(Scanner *scanner, TSLexer *lexer) {

codee/patches/0012-Stop-parsing-continuation-lines-in-number-literals.patch

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ them as a parsing error. This allows library users to handle such cases
99
explicitly.
1010
---
1111
src/scanner.c | 104 +++++++++++++++++++----------
12-
test/corpus/expressions.txt | 33 ++++-----
12+
test/corpus/expressions.txt | 31 ++++-----
1313
test/corpus/line_continuations.txt | 3 +-
14-
3 files changed, 86 insertions(+), 54 deletions(-)
14+
3 files changed, 85 insertions(+), 53 deletions(-)
1515

1616
diff --git a/src/scanner.c b/src/scanner.c
17-
index 66f3fc9..86d4135 100644
17+
index 846a5d8..4b1a626 100644
1818
--- a/src/scanner.c
1919
+++ b/src/scanner.c
2020
@@ -41,6 +41,7 @@ typedef struct {
@@ -166,7 +166,7 @@ index 66f3fc9..86d4135 100644
166166
return result;
167167
}
168168

169-
@@ -540,37 +561,41 @@ static bool scan_do_label_continue(Scanner *scanner, TSLexer *lexer, int32_t lab
169+
@@ -542,37 +563,41 @@ static bool scan_do_label_continue(Scanner *scanner, TSLexer *lexer, int32_t lab
170170
}
171171

172172
// check for label, number of boz token
@@ -215,7 +215,7 @@ index 66f3fc9..86d4135 100644
215215
}
216216

217217
static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
218-
@@ -627,8 +652,13 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
218+
@@ -629,8 +654,13 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
219219
valid_symbols[BOZ_LITERAL] ||
220220
valid_symbols[DO_LABEL] ||
221221
valid_symbols[DO_LABEL_CONTINUE]) {
@@ -231,18 +231,9 @@ index 66f3fc9..86d4135 100644
231231
}
232232

233233
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
234-
index c6b7225..f55923b 100644
234+
index c6b7225..623668b 100644
235235
--- a/test/corpus/expressions.txt
236236
+++ b/test/corpus/expressions.txt
237-
@@ -964,7 +964,7 @@ program test
238-
iostat=istat, & ! Comment followed by line continuation
239-
& iomsg=imsg)
240-
! Note trailing whitespace after line continuation on next line
241-
- error &
242-
+ error &
243-
stop
244-
end program
245-
246237
@@ -1048,9 +1048,11 @@ end program
247238
(variable_declaration
248239
(intrinsic_type)

codee/patches/0013-Ensure-nodes-appear-in-the-syntax-tree.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ index 4714989..bf52443 100644
4040
// Due to the fact Fortran uses parentheses for both function calls and
4141
// array access there is no way to differentiate the two except for the
4242
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
43-
index f55923b..f1f67b5 100644
43+
index 623668b..2c56a86 100644
4444
--- a/test/corpus/expressions.txt
4545
+++ b/test/corpus/expressions.txt
4646
@@ -1070,8 +1070,12 @@ end program

codee/patches/0014-Allow-to-parse-macro-identifiers.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ index bf52443..afec324 100644
4545

4646
parenthesized_expression: $ => seq(
4747
diff --git a/src/scanner.c b/src/scanner.c
48-
index 86d4135..2c83a47 100644
48+
index 4b1a626..87cb1b7 100644
4949
--- a/src/scanner.c
5050
+++ b/src/scanner.c
5151
@@ -1,8 +1,9 @@
@@ -173,7 +173,7 @@ index 86d4135..2c83a47 100644
173173
/// Need an external scanner to catch '!' before its parsed as a comment
174174
static bool scan_preproc_unary_operator(TSLexer *lexer) {
175175
const char next_char = lexer->lookahead;
176-
@@ -672,14 +720,34 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
176+
@@ -674,14 +722,34 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) {
177177
return true;
178178
}
179179

@@ -211,7 +211,7 @@ index 86d4135..2c83a47 100644
211211
return false;
212212
}
213213

214-
@@ -689,6 +757,25 @@ void *tree_sitter_fortran_external_scanner_create() {
214+
@@ -691,6 +759,25 @@ void *tree_sitter_fortran_external_scanner_create() {
215215
scanner->depth = 0;
216216
scanner->pending_label_virtual = 0;
217217
scanner->is_pending_eos_virtual = false;
@@ -237,7 +237,7 @@ index 86d4135..2c83a47 100644
237237
return scanner;
238238
}
239239

240-
@@ -724,6 +811,9 @@ unsigned tree_sitter_fortran_external_scanner_serialize(void *payload,
240+
@@ -726,6 +813,9 @@ unsigned tree_sitter_fortran_external_scanner_serialize(void *payload,
241241
buffer[size] = (char)scanner->is_pending_eos_virtual;
242242
size += 1;
243243

@@ -247,7 +247,7 @@ index 86d4135..2c83a47 100644
247247
return size;
248248
}
249249

250-
@@ -766,9 +856,18 @@ void tree_sitter_fortran_external_scanner_deserialize(void *payload,
250+
@@ -768,9 +858,18 @@ void tree_sitter_fortran_external_scanner_deserialize(void *payload,
251251

252252
scanner->is_pending_eos_virtual = buffer[size];
253253
size += 1;

codee/patches/0015-Unhide-_string_literal.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ index ed23535..8ffadde 100644
172172
(identifier))
173173
(end_of_statement))
174174
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
175-
index f1f67b5..d1df55b 100644
175+
index 2c56a86..89412d2 100644
176176
--- a/test/corpus/expressions.txt
177177
+++ b/test/corpus/expressions.txt
178178
@@ -191,55 +191,67 @@ END PROGRAM

0 commit comments

Comments
 (0)