Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codee/patches/0005-Consume-end_of_statement.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ they can also be consumed as `comment` tokens).
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index 188fa2b..66f3fc9 100644
index b11f0b2..846a5d8 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -288,7 +288,7 @@ static bool scan_end_of_statement(Scanner *scanner, TSLexer *lexer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ them as a parsing error. This allows library users to handle such cases
explicitly.
---
src/scanner.c | 104 +++++++++++++++++++----------
test/corpus/expressions.txt | 33 ++++-----
test/corpus/expressions.txt | 31 ++++-----
test/corpus/line_continuations.txt | 3 +-
3 files changed, 86 insertions(+), 54 deletions(-)
3 files changed, 85 insertions(+), 53 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index 66f3fc9..86d4135 100644
index 846a5d8..4b1a626 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -41,6 +41,7 @@ typedef struct {
Expand Down Expand Up @@ -166,7 +166,7 @@ index 66f3fc9..86d4135 100644
return result;
}

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

// check for label, number of boz token
Expand Down Expand Up @@ -215,7 +215,7 @@ index 66f3fc9..86d4135 100644
}

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

diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index c6b7225..f55923b 100644
index c6b7225..623668b 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -964,7 +964,7 @@ program test
iostat=istat, & ! Comment followed by line continuation
& iomsg=imsg)
! Note trailing whitespace after line continuation on next line
- error &
+ error &
stop
end program

@@ -1048,9 +1048,11 @@ end program
(variable_declaration
(intrinsic_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ index 4714989..bf52443 100644
// Due to the fact Fortran uses parentheses for both function calls and
// array access there is no way to differentiate the two except for the
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index f55923b..f1f67b5 100644
index 623668b..2c56a86 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -1070,8 +1070,12 @@ end program
Expand Down
10 changes: 5 additions & 5 deletions codee/patches/0014-Allow-to-parse-macro-identifiers.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ index bf52443..afec324 100644

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

Expand Down Expand Up @@ -211,7 +211,7 @@ index 86d4135..2c83a47 100644
return false;
}

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

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

Expand All @@ -247,7 +247,7 @@ index 86d4135..2c83a47 100644
return size;
}

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

scanner->is_pending_eos_virtual = buffer[size];
size += 1;
Expand Down
2 changes: 1 addition & 1 deletion codee/patches/0015-Unhide-_string_literal.patch
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ index ed23535..8ffadde 100644
(identifier))
(end_of_statement))
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index f1f67b5..d1df55b 100644
index 2c56a86..89412d2 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -191,55 +191,67 @@ END PROGRAM
Expand Down
Loading