Skip to content

Merge tree-sitter-fortran #11

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

Closed
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/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