Skip to content

Merge tree-sitter-fortran #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a5a15a9
Split the aliasing of `end` statements
ZedThree Apr 3, 2025
c687ba7
Merge pull request #140 from stadelmanma/split-end-block
stadelmanma May 28, 2025
5b7490b
Bump tree-sitter version and regenerate
ZedThree May 16, 2025
52a59d5
Fix warning in scanner
ZedThree May 16, 2025
0cbfc85
Fix string literals immediately followed by line continuation
ZedThree May 16, 2025
cda402d
Fix more keyword/identifier clashes
ZedThree May 16, 2025
b3b9be2
Add `deallocate` and `nullify` statements
ZedThree May 30, 2025
1f29192
Add `flush` and `wait`
ZedThree May 30, 2025
4bef32b
Fix clash between `format` and `call_expression`
ZedThree May 30, 2025
d72ba8e
Add Cray pointers
ZedThree May 23, 2025
b3947ae
Add `operator_name` node to generic `operator`
ZedThree May 28, 2025
65ce830
Fix catching number literals immediately followed by `&`
ZedThree May 30, 2025
8ae4aa9
Add expressions and statements as supertypes
ZedThree May 23, 2025
614162a
Add `_argument_item` as a supertype
ZedThree May 28, 2025
b4c3566
Add `_specification_parts` as supertype
ZedThree May 30, 2025
3ef6401
Small optimisation of supertypes
ZedThree May 30, 2025
1e7c2a8
Merge pull request #141 from stadelmanma/fix-string-literal-continuation
stadelmanma May 30, 2025
b7ed36e
Merge pull request #143 from stadelmanma/fix-more-identifier-keyword-…
stadelmanma May 30, 2025
ab9aa00
Merge pull request #148 from stadelmanma/supertypes
stadelmanma May 30, 2025
8981e63
Add extension for data declarators
ZedThree Jun 2, 2025
c4be218
Allow quad literal exponent
ZedThree Jun 2, 2025
e67a15f
Allow type-spec in implied-do-loops
ZedThree Jun 2, 2025
bb2fd6a
Add `asynchronous` attribute
ZedThree Jun 2, 2025
e8aa6d8
Add `mold` argument to `null` literal
ZedThree Jun 2, 2025
bd3f76b
Allow `entry` statement in specification part
ZedThree Jun 2, 2025
9f76f77
Allow empty `select` constructs
ZedThree Jun 2, 2025
c503a04
Allow `type`/`class` in `implicit` statements
ZedThree Jun 2, 2025
f0c1b13
Allow type-spec in procedure-interface
ZedThree Jun 2, 2025
daa0d21
Allow semicolons in `type` definitions
ZedThree Jun 2, 2025
4edfed9
Add `bind_statement` as new node
ZedThree Jun 2, 2025
1333cf5
Allow integer as literal string kind
ZedThree Jun 2, 2025
92952ed
Allow `fmt` argument without keyword argument
ZedThree Jun 2, 2025
8735d21
Fix wait and flush not appearing as file_position_statement
LiamPattinson Jun 9, 2025
981d7ca
Test that wait and flush are file_position_statments
LiamPattinson Jun 9, 2025
5d1a029
Merge pull request #149 from stadelmanma/more-extensions
stadelmanma Jun 10, 2025
e28fd2f
Merge pull request #151 from LiamPattinson/fix-wait-and-flush
stadelmanma Jun 10, 2025
1b08f4c
Merge pull request #152 from stadelmanma/more-extensions
ZedThree Jun 10, 2025
ff47e0e
Merge tree-sitter-fortran/master
inaki-amatria Jun 20, 2025
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/0001-Add-TypeScript-source-annotation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: Add TypeScript source annotation
1 file changed, 6 insertions(+)

diff --git a/grammar.js b/grammar.js
index bcae961..6c99d98 100644
index dd65a87..a89ba01 100644
--- a/grammar.js
+++ b/grammar.js
@@ -14,6 +14,12 @@
Expand Down
48 changes: 0 additions & 48 deletions codee/patches/0002-Allow-empty-select-statements.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ Subject: Unalias keywords that are `identifier`s

so they don't show as unnamed children of `identifier`s nodes.
---
grammar.js | 116 ++++++++++++++++++------------------
test/corpus/expressions.txt | 31 ++++++++++
2 files changed, 89 insertions(+), 58 deletions(-)
grammar.js | 126 ++++++++++++++++++------------------
test/corpus/expressions.txt | 31 +++++++++
2 files changed, 94 insertions(+), 63 deletions(-)

diff --git a/grammar.js b/grammar.js
index 7420a1d..4856695 100644
index a89ba01..4e6a7f1 100644
--- a/grammar.js
+++ b/grammar.js
@@ -2184,64 +2184,64 @@ module.exports = grammar({
@@ -2281,69 +2281,69 @@ module.exports = grammar({
// add the keywords here -- and possibly in `conflicts` too.
identifier: $ => choice(
/[a-zA-Z_$][\w$]*/,
- caseInsensitive('allocatable'),
- caseInsensitive('asynchronous'),
- caseInsensitive('automatic'),
- caseInsensitive('block'),
- caseInsensitive('byte'),
Expand All @@ -31,6 +32,7 @@ index 7420a1d..4856695 100644
- caseInsensitive('device'),
- prec(-1, caseInsensitive('dimension')),
- caseInsensitive('double'),
- caseInsensitive('else'),
- caseInsensitive('elseif'),
- caseInsensitive('end'),
- caseInsensitive('endif'),
Expand All @@ -40,6 +42,7 @@ index 7420a1d..4856695 100644
- caseInsensitive('exit'),
- caseInsensitive('external'),
- caseInsensitive('fail'),
- prec(-1, caseInsensitive('flush')),
- caseInsensitive('form'),
- caseInsensitive('format'),
- caseInsensitive('go'),
Expand Down Expand Up @@ -71,11 +74,14 @@ index 7420a1d..4856695 100644
- caseInsensitive('target'),
- caseInsensitive('texture'),
- prec(-1, caseInsensitive('type')),
- caseInsensitive('unit'),
- caseInsensitive('unlock'),
- caseInsensitive('value'),
- prec(-1, caseInsensitive('wait')),
- prec(-1, caseInsensitive('where')),
- caseInsensitive('write'),
+ caseInsensitive('allocatable', false),
+ caseInsensitive('asynchronous', false),
+ caseInsensitive('automatic', false),
+ caseInsensitive('block', false),
+ caseInsensitive('byte', false),
Expand All @@ -89,6 +95,7 @@ index 7420a1d..4856695 100644
+ caseInsensitive('device', false),
+ prec(-1, caseInsensitive('dimension', false)),
+ caseInsensitive('double', false),
+ caseInsensitive('else', false),
+ caseInsensitive('elseif', false),
+ caseInsensitive('end', false),
+ caseInsensitive('endif', false),
Expand All @@ -98,6 +105,7 @@ index 7420a1d..4856695 100644
+ caseInsensitive('exit', false),
+ caseInsensitive('external', false),
+ caseInsensitive('fail', false),
+ prec(-1, caseInsensitive('flush', false)),
+ caseInsensitive('form', false),
+ caseInsensitive('format', false),
+ caseInsensitive('go', false),
Expand Down Expand Up @@ -129,18 +137,20 @@ index 7420a1d..4856695 100644
+ caseInsensitive('target', false),
+ caseInsensitive('texture', false),
+ prec(-1, caseInsensitive('type', false)),
+ caseInsensitive('unit', false),
+ caseInsensitive('unlock', false),
+ caseInsensitive('value', false),
+ prec(-1, caseInsensitive('wait', false)),
+ prec(-1, caseInsensitive('where', false)),
+ caseInsensitive('write', false),
),

comment: $ => token(seq('!', /.*/)),
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index 35a07c7..b17afad 100644
index 7032b51..c5a8f3d 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -1272,3 +1272,34 @@ end program test
@@ -1348,3 +1348,34 @@ end program test
(comment)
(end_program_statement
(name))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Subject: Add semantic accessors
6 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/grammar.js b/grammar.js
index 4856695..50204e4 100644
index 4e6a7f1..d0af7b9 100644
--- a/grammar.js
+++ b/grammar.js
@@ -291,7 +291,11 @@ module.exports = grammar({
@@ -302,7 +302,11 @@ module.exports = grammar({
$.end_program_statement
),

Expand All @@ -29,7 +29,7 @@ index 4856695..50204e4 100644
end_program_statement: $ => blockStructureEnding($, 'program'),

module: $ => seq(
@@ -307,7 +311,11 @@ module.exports = grammar({
@@ -318,7 +322,11 @@ module.exports = grammar({
$.end_module_statement
),

Expand All @@ -42,7 +42,7 @@ index 4856695..50204e4 100644
end_module_statement: $ => blockStructureEnding($, 'module'),

submodule: $ => seq(
@@ -331,7 +339,7 @@ module.exports = grammar({
@@ -342,7 +350,7 @@ module.exports = grammar({
':', field('parent', $.module_name)
)),
')',
Expand All @@ -51,7 +51,7 @@ index 4856695..50204e4 100644
$._end_of_statement,
),
end_submodule_statement: $ => blockStructureEnding($, 'submodule'),
@@ -363,7 +371,7 @@ module.exports = grammar({
@@ -374,7 +382,7 @@ module.exports = grammar({
interface_statement: $ => seq(
optional($.abstract_specifier),
caseInsensitive('interface'),
Expand All @@ -60,7 +60,7 @@ index 4856695..50204e4 100644
$._end_of_statement,
),

@@ -734,8 +742,13 @@ module.exports = grammar({
@@ -768,8 +776,13 @@ module.exports = grammar({
optional($.statement_label),
caseInsensitive('type'),
choice(
Expand All @@ -75,8 +75,8 @@ index 4856695..50204e4 100644
+ )
),
optional(alias($.argument_list, $.derived_type_parameter_list)),
$._end_of_statement
@@ -1960,7 +1973,7 @@ module.exports = grammar({
$._end_of_statement,
@@ -2048,7 +2061,7 @@ module.exports = grammar({
// precedence is used to prevent conflict with assignment expression
keyword_argument: $ => prec(1, seq(
field("name",$.identifier),
Expand All @@ -86,10 +86,10 @@ index 4856695..50204e4 100644
)),

diff --git a/test/corpus/constructs.txt b/test/corpus/constructs.txt
index ae3b766..ead1f53 100644
index ab165f0..9b2eccb 100644
--- a/test/corpus/constructs.txt
+++ b/test/corpus/constructs.txt
@@ -980,12 +980,12 @@ end program
@@ -988,12 +988,12 @@ end program
(translation_unit
(program
(program_statement
Expand All @@ -104,7 +104,7 @@ index ae3b766..ead1f53 100644
(end_type_statement
(name)))
(derived_type_definition
@@ -993,7 +993,7 @@ end program
@@ -1001,7 +1001,7 @@ end program
access: (access_specifier)
base: (base_type_specifier
(identifier))
Expand All @@ -114,10 +114,10 @@ index ae3b766..ead1f53 100644
(name)))
(end_program_statement)))
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index b17afad..254c65f 100644
index c5a8f3d..eb8b11c 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -158,7 +158,7 @@ END PROGRAM
@@ -159,7 +159,7 @@ END PROGRAM
(translation_unit
(program
(program_statement
Expand All @@ -126,7 +126,7 @@ index b17afad..254c65f 100644
(assignment_statement
left: (identifier)
right: (string_literal))
@@ -237,7 +237,7 @@ end program
@@ -242,7 +242,7 @@ end program
(translation_unit
(program
(program_statement
Expand All @@ -135,7 +135,7 @@ index b17afad..254c65f 100644
(variable_declaration
type: (intrinsic_type)
declarator: (init_declarator
@@ -712,7 +712,7 @@ END PROGRAM
@@ -717,7 +717,7 @@ END PROGRAM
(translation_unit
(program
(program_statement
Expand Down Expand Up @@ -198,10 +198,10 @@ index fc47bf1..1af946a 100644
left: (call_expression
(identifier)
diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt
index 2405c0d..7fdbf31 100644
index ca8c86e..ad47d68 100644
--- a/test/corpus/statements.txt
+++ b/test/corpus/statements.txt
@@ -277,7 +277,7 @@ END PROGRAM
@@ -289,7 +289,7 @@ END PROGRAM
(translation_unit
(program
(program_statement
Expand All @@ -210,7 +210,7 @@ index 2405c0d..7fdbf31 100644
(variable_declaration
type: (intrinsic_type)
attribute: (type_qualifier)
@@ -787,7 +787,7 @@ END PROGRAM TEST
@@ -799,7 +799,7 @@ END PROGRAM TEST
(translation_unit
(program
(program_statement
Expand All @@ -219,7 +219,7 @@ index 2405c0d..7fdbf31 100644
(variable_declaration
type: (intrinsic_type)
attribute: (type_qualifier
@@ -1935,7 +1935,7 @@ END PROGRAM test
@@ -1961,7 +1961,7 @@ END PROGRAM test
(translation_unit
(program
(program_statement
Expand All @@ -228,7 +228,7 @@ index 2405c0d..7fdbf31 100644
(enum
(enum_statement
(language_binding
@@ -2661,7 +2661,7 @@ end program test
@@ -2711,7 +2711,7 @@ end program test
(translation_unit
(program
(program_statement
Expand Down
Loading
Loading