Skip to content

Commit 210a9dc

Browse files
committed
Merge tree-sitter-fortran/master
2 parents 0e770a5 + e013289 commit 210a9dc

34 files changed

+755092
-748082
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ project(tree-sitter-fortran
99
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
1010
option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF)
1111

12+
# Ensure wide character functions (iswblank, iswxdigit, etc.) are visible
13+
# when compiling in strict C11 mode on POSIX systems
14+
if(UNIX)
15+
add_compile_definitions(_XOPEN_SOURCE=700)
16+
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|NetBSD|DragonFly|OpenBSD")
17+
add_compile_definitions(_BSD_VISIBLE)
18+
endif()
19+
endif()
20+
1221
set(TREE_SITTER_ABI_VERSION 14 CACHE STRING "Tree-sitter ABI version")
1322
if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$")
1423
unset(TREE_SITTER_ABI_VERSION CACHE)

codee/patches/0001-Add-TypeScript-source-annotation.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Subject: Add TypeScript source annotation
88
1 file changed, 6 insertions(+)
99

1010
diff --git a/grammar.js b/grammar.js
11-
index dd65a87..a89ba01 100644
11+
index 8b9f384..4f84bdb 100644
1212
--- a/grammar.js
1313
+++ b/grammar.js
1414
@@ -14,6 +14,12 @@

codee/patches/0002-Unalias-keywords-that-are-identifier-s.patch

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Subject: Unalias keywords that are `identifier`s
55

66
so they don't show as unnamed children of `identifier`s nodes.
77
---
8-
grammar.js | 126 ++++++++++++++++++------------------
8+
grammar.js | 130 ++++++++++++++++++------------------
99
test/corpus/expressions.txt | 31 +++++++++
10-
2 files changed, 94 insertions(+), 63 deletions(-)
10+
2 files changed, 96 insertions(+), 65 deletions(-)
1111

1212
diff --git a/grammar.js b/grammar.js
13-
index a89ba01..4e6a7f1 100644
13+
index 4f84bdb..bd68a65 100644
1414
--- a/grammar.js
1515
+++ b/grammar.js
16-
@@ -2281,69 +2281,69 @@ module.exports = grammar({
16+
@@ -2292,71 +2292,71 @@ module.exports = grammar({
1717
// add the keywords here -- and possibly in `conflicts` too.
1818
identifier: $ => choice(
1919
/[a-zA-Z_$][\w$]*/,
@@ -31,6 +31,7 @@ index a89ba01..4e6a7f1 100644
3131
- caseInsensitive('data'),
3232
- caseInsensitive('device'),
3333
- prec(-1, caseInsensitive('dimension')),
34+
- caseInsensitive('do'),
3435
- caseInsensitive('double'),
3536
- caseInsensitive('else'),
3637
- caseInsensitive('elseif'),
@@ -43,6 +44,7 @@ index a89ba01..4e6a7f1 100644
4344
- caseInsensitive('external'),
4445
- caseInsensitive('fail'),
4546
- prec(-1, caseInsensitive('flush')),
47+
- caseInsensitive('fmt'),
4648
- caseInsensitive('form'),
4749
- caseInsensitive('format'),
4850
- caseInsensitive('go'),
@@ -94,6 +96,7 @@ index a89ba01..4e6a7f1 100644
9496
+ caseInsensitive('data', false),
9597
+ caseInsensitive('device', false),
9698
+ prec(-1, caseInsensitive('dimension', false)),
99+
+ caseInsensitive('do', false),
97100
+ caseInsensitive('double', false),
98101
+ caseInsensitive('else', false),
99102
+ caseInsensitive('elseif', false),
@@ -106,6 +109,7 @@ index a89ba01..4e6a7f1 100644
106109
+ caseInsensitive('external', false),
107110
+ caseInsensitive('fail', false),
108111
+ prec(-1, caseInsensitive('flush', false)),
112+
+ caseInsensitive('fmt', false),
109113
+ caseInsensitive('form', false),
110114
+ caseInsensitive('format', false),
111115
+ caseInsensitive('go', false),
@@ -147,10 +151,10 @@ index a89ba01..4e6a7f1 100644
147151

148152
comment: $ => token(seq('!', /.*/)),
149153
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
150-
index 7032b51..c5a8f3d 100644
154+
index 384393d..63781fa 100644
151155
--- a/test/corpus/expressions.txt
152156
+++ b/test/corpus/expressions.txt
153-
@@ -1348,3 +1348,34 @@ end program test
157+
@@ -1355,3 +1355,34 @@ end program test
154158
(comment)
155159
(end_program_statement
156160
(name))))

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Subject: Add semantic accessors
1313
6 files changed, 36 insertions(+), 23 deletions(-)
1414

1515
diff --git a/grammar.js b/grammar.js
16-
index 4e6a7f1..d0af7b9 100644
16+
index bd68a65..1289710 100644
1717
--- a/grammar.js
1818
+++ b/grammar.js
19-
@@ -302,7 +302,11 @@ module.exports = grammar({
19+
@@ -305,7 +305,11 @@ module.exports = grammar({
2020
$.end_program_statement
2121
),
2222

@@ -29,7 +29,7 @@ index 4e6a7f1..d0af7b9 100644
2929
end_program_statement: $ => blockStructureEnding($, 'program'),
3030

3131
module: $ => seq(
32-
@@ -318,7 +322,11 @@ module.exports = grammar({
32+
@@ -321,7 +325,11 @@ module.exports = grammar({
3333
$.end_module_statement
3434
),
3535

@@ -42,7 +42,7 @@ index 4e6a7f1..d0af7b9 100644
4242
end_module_statement: $ => blockStructureEnding($, 'module'),
4343

4444
submodule: $ => seq(
45-
@@ -342,7 +350,7 @@ module.exports = grammar({
45+
@@ -345,7 +353,7 @@ module.exports = grammar({
4646
':', field('parent', $.module_name)
4747
)),
4848
')',
@@ -51,7 +51,7 @@ index 4e6a7f1..d0af7b9 100644
5151
$._end_of_statement,
5252
),
5353
end_submodule_statement: $ => blockStructureEnding($, 'submodule'),
54-
@@ -374,7 +382,7 @@ module.exports = grammar({
54+
@@ -377,7 +385,7 @@ module.exports = grammar({
5555
interface_statement: $ => seq(
5656
optional($.abstract_specifier),
5757
caseInsensitive('interface'),
@@ -60,7 +60,7 @@ index 4e6a7f1..d0af7b9 100644
6060
$._end_of_statement,
6161
),
6262

63-
@@ -768,8 +776,13 @@ module.exports = grammar({
63+
@@ -771,8 +779,13 @@ module.exports = grammar({
6464
optional($.statement_label),
6565
caseInsensitive('type'),
6666
choice(
@@ -76,7 +76,7 @@ index 4e6a7f1..d0af7b9 100644
7676
),
7777
optional(alias($.argument_list, $.derived_type_parameter_list)),
7878
$._end_of_statement,
79-
@@ -2048,7 +2061,7 @@ module.exports = grammar({
79+
@@ -2059,7 +2072,7 @@ module.exports = grammar({
8080
// precedence is used to prevent conflict with assignment expression
8181
keyword_argument: $ => prec(1, seq(
8282
field("name",$.identifier),
@@ -114,7 +114,7 @@ index ab165f0..9b2eccb 100644
114114
(name)))
115115
(end_program_statement)))
116116
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
117-
index c5a8f3d..eb8b11c 100644
117+
index 63781fa..cf7f6c4 100644
118118
--- a/test/corpus/expressions.txt
119119
+++ b/test/corpus/expressions.txt
120120
@@ -159,7 +159,7 @@ END PROGRAM
@@ -135,7 +135,7 @@ index c5a8f3d..eb8b11c 100644
135135
(variable_declaration
136136
type: (intrinsic_type)
137137
declarator: (init_declarator
138-
@@ -717,7 +717,7 @@ END PROGRAM
138+
@@ -724,7 +724,7 @@ END PROGRAM
139139
(translation_unit
140140
(program
141141
(program_statement
@@ -145,10 +145,10 @@ index c5a8f3d..eb8b11c 100644
145145
left: (identifier)
146146
right: (call_expression
147147
diff --git a/test/corpus/preprocessor.txt b/test/corpus/preprocessor.txt
148-
index 4fe227d..29175d5 100644
148+
index d9dd3a3..a42ff39 100644
149149
--- a/test/corpus/preprocessor.txt
150150
+++ b/test/corpus/preprocessor.txt
151-
@@ -434,7 +434,7 @@ end program
151+
@@ -453,7 +453,7 @@ end program
152152
(translation_unit
153153
(program
154154
(program_statement
@@ -157,7 +157,7 @@ index 4fe227d..29175d5 100644
157157
(use_statement
158158
(module_name)
159159
(included_items
160-
@@ -522,7 +522,7 @@ end module foo
160+
@@ -541,7 +541,7 @@ end module foo
161161
(translation_unit
162162
(module
163163
(module_statement
@@ -166,7 +166,7 @@ index 4fe227d..29175d5 100644
166166
(internal_procedures
167167
(contains_statement)
168168
(subroutine
169-
@@ -572,7 +572,7 @@ end module foo
169+
@@ -591,7 +591,7 @@ end module foo
170170
(translation_unit
171171
(module
172172
(module_statement
@@ -175,7 +175,7 @@ index 4fe227d..29175d5 100644
175175
(internal_procedures
176176
(contains_statement)
177177
(subroutine
178-
@@ -632,7 +632,7 @@ end module foo
178+
@@ -651,7 +651,7 @@ end module foo
179179
(translation_unit
180180
(module
181181
(module_statement
@@ -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..d6bebae 100644
201+
index 2065d4f..96bef40 100644
202202
--- a/test/corpus/statements.txt
203203
+++ b/test/corpus/statements.txt
204204
@@ -289,7 +289,7 @@ END PROGRAM
@@ -210,7 +210,7 @@ index ca8c86e..d6bebae 100644
210210
(variable_declaration
211211
type: (intrinsic_type)
212212
attribute: (type_qualifier)
213-
@@ -799,7 +799,7 @@ END PROGRAM TEST
213+
@@ -805,7 +805,7 @@ END PROGRAM TEST
214214
(translation_unit
215215
(program
216216
(program_statement
@@ -219,7 +219,7 @@ index ca8c86e..d6bebae 100644
219219
(variable_declaration
220220
type: (intrinsic_type)
221221
attribute: (type_qualifier
222-
@@ -1961,7 +1961,7 @@ END PROGRAM test
222+
@@ -1987,7 +1987,7 @@ END PROGRAM test
223223
(translation_unit
224224
(program
225225
(program_statement
@@ -228,7 +228,7 @@ index ca8c86e..d6bebae 100644
228228
(enum
229229
(enum_statement
230230
(language_binding
231-
@@ -2711,7 +2711,7 @@ end program test
231+
@@ -2748,7 +2748,7 @@ end program test
232232
(translation_unit
233233
(program
234234
(program_statement
@@ -237,7 +237,7 @@ index ca8c86e..d6bebae 100644
237237
(allocate_statement
238238
allocation: (sized_allocation
239239
(identifier)
240-
@@ -3499,7 +3499,7 @@ end program
240+
@@ -3536,7 +3536,7 @@ end program
241241
(translation_unit
242242
(program
243243
(program_statement

0 commit comments

Comments
 (0)