Skip to content
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 dd65a87..a89ba01 100644
index 8b9f384..4f84bdb 100644
--- a/grammar.js
+++ b/grammar.js
@@ -14,6 +14,12 @@
Expand Down
16 changes: 10 additions & 6 deletions codee/patches/0002-Unalias-keywords-that-are-identifier-s.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Subject: Unalias keywords that are `identifier`s

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

diff --git a/grammar.js b/grammar.js
index a89ba01..4e6a7f1 100644
index 4f84bdb..bd68a65 100644
--- a/grammar.js
+++ b/grammar.js
@@ -2281,69 +2281,69 @@ module.exports = grammar({
@@ -2292,71 +2292,71 @@ module.exports = grammar({
// add the keywords here -- and possibly in `conflicts` too.
identifier: $ => choice(
/[a-zA-Z_$][\w$]*/,
Expand All @@ -31,6 +31,7 @@ index a89ba01..4e6a7f1 100644
- caseInsensitive('data'),
- caseInsensitive('device'),
- prec(-1, caseInsensitive('dimension')),
- caseInsensitive('do'),
- caseInsensitive('double'),
- caseInsensitive('else'),
- caseInsensitive('elseif'),
Expand All @@ -43,6 +44,7 @@ index a89ba01..4e6a7f1 100644
- caseInsensitive('external'),
- caseInsensitive('fail'),
- prec(-1, caseInsensitive('flush')),
- caseInsensitive('fmt'),
- caseInsensitive('form'),
- caseInsensitive('format'),
- caseInsensitive('go'),
Expand Down Expand Up @@ -94,6 +96,7 @@ index a89ba01..4e6a7f1 100644
+ caseInsensitive('data', false),
+ caseInsensitive('device', false),
+ prec(-1, caseInsensitive('dimension', false)),
+ caseInsensitive('do', false),
+ caseInsensitive('double', false),
+ caseInsensitive('else', false),
+ caseInsensitive('elseif', false),
Expand All @@ -106,6 +109,7 @@ index a89ba01..4e6a7f1 100644
+ caseInsensitive('external', false),
+ caseInsensitive('fail', false),
+ prec(-1, caseInsensitive('flush', false)),
+ caseInsensitive('fmt', false),
+ caseInsensitive('form', false),
+ caseInsensitive('format', false),
+ caseInsensitive('go', false),
Expand Down Expand Up @@ -147,10 +151,10 @@ index a89ba01..4e6a7f1 100644

comment: $ => token(seq('!', /.*/)),
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index 7032b51..c5a8f3d 100644
index 384393d..63781fa 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -1348,3 +1348,34 @@ end program test
@@ -1355,3 +1355,34 @@ end program test
(comment)
(end_program_statement
(name))))
Expand Down
38 changes: 19 additions & 19 deletions codee/patches/0003-Add-semantic-accessors.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Subject: Add semantic accessors
6 files changed, 36 insertions(+), 23 deletions(-)

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

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

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

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

submodule: $ => seq(
@@ -342,7 +350,7 @@ module.exports = grammar({
@@ -345,7 +353,7 @@ module.exports = grammar({
':', field('parent', $.module_name)
)),
')',
Expand All @@ -51,7 +51,7 @@ index 4e6a7f1..d0af7b9 100644
$._end_of_statement,
),
end_submodule_statement: $ => blockStructureEnding($, 'submodule'),
@@ -374,7 +382,7 @@ module.exports = grammar({
@@ -377,7 +385,7 @@ module.exports = grammar({
interface_statement: $ => seq(
optional($.abstract_specifier),
caseInsensitive('interface'),
Expand All @@ -60,7 +60,7 @@ index 4e6a7f1..d0af7b9 100644
$._end_of_statement,
),

@@ -768,8 +776,13 @@ module.exports = grammar({
@@ -771,8 +779,13 @@ module.exports = grammar({
optional($.statement_label),
caseInsensitive('type'),
choice(
Expand All @@ -76,7 +76,7 @@ index 4e6a7f1..d0af7b9 100644
),
optional(alias($.argument_list, $.derived_type_parameter_list)),
$._end_of_statement,
@@ -2048,7 +2061,7 @@ module.exports = grammar({
@@ -2059,7 +2072,7 @@ module.exports = grammar({
// precedence is used to prevent conflict with assignment expression
keyword_argument: $ => prec(1, seq(
field("name",$.identifier),
Expand Down Expand Up @@ -114,7 +114,7 @@ index ab165f0..9b2eccb 100644
(name)))
(end_program_statement)))
diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt
index c5a8f3d..eb8b11c 100644
index 63781fa..cf7f6c4 100644
--- a/test/corpus/expressions.txt
+++ b/test/corpus/expressions.txt
@@ -159,7 +159,7 @@ END PROGRAM
Expand All @@ -135,7 +135,7 @@ index c5a8f3d..eb8b11c 100644
(variable_declaration
type: (intrinsic_type)
declarator: (init_declarator
@@ -717,7 +717,7 @@ END PROGRAM
@@ -724,7 +724,7 @@ END PROGRAM
(translation_unit
(program
(program_statement
Expand All @@ -145,10 +145,10 @@ index c5a8f3d..eb8b11c 100644
left: (identifier)
right: (call_expression
diff --git a/test/corpus/preprocessor.txt b/test/corpus/preprocessor.txt
index 4fe227d..29175d5 100644
index d9dd3a3..a42ff39 100644
--- a/test/corpus/preprocessor.txt
+++ b/test/corpus/preprocessor.txt
@@ -434,7 +434,7 @@ end program
@@ -453,7 +453,7 @@ end program
(translation_unit
(program
(program_statement
Expand All @@ -157,7 +157,7 @@ index 4fe227d..29175d5 100644
(use_statement
(module_name)
(included_items
@@ -522,7 +522,7 @@ end module foo
@@ -541,7 +541,7 @@ end module foo
(translation_unit
(module
(module_statement
Expand All @@ -166,7 +166,7 @@ index 4fe227d..29175d5 100644
(internal_procedures
(contains_statement)
(subroutine
@@ -572,7 +572,7 @@ end module foo
@@ -591,7 +591,7 @@ end module foo
(translation_unit
(module
(module_statement
Expand All @@ -175,7 +175,7 @@ index 4fe227d..29175d5 100644
(internal_procedures
(contains_statement)
(subroutine
@@ -632,7 +632,7 @@ end module foo
@@ -651,7 +651,7 @@ end module foo
(translation_unit
(module
(module_statement
Expand All @@ -198,7 +198,7 @@ index fc47bf1..1af946a 100644
left: (call_expression
(identifier)
diff --git a/test/corpus/statements.txt b/test/corpus/statements.txt
index ca8c86e..d6bebae 100644
index 2065d4f..96bef40 100644
--- a/test/corpus/statements.txt
+++ b/test/corpus/statements.txt
@@ -289,7 +289,7 @@ END PROGRAM
Expand All @@ -210,7 +210,7 @@ index ca8c86e..d6bebae 100644
(variable_declaration
type: (intrinsic_type)
attribute: (type_qualifier)
@@ -799,7 +799,7 @@ END PROGRAM TEST
@@ -805,7 +805,7 @@ END PROGRAM TEST
(translation_unit
(program
(program_statement
Expand All @@ -219,7 +219,7 @@ index ca8c86e..d6bebae 100644
(variable_declaration
type: (intrinsic_type)
attribute: (type_qualifier
@@ -1961,7 +1961,7 @@ END PROGRAM test
@@ -1987,7 +1987,7 @@ END PROGRAM test
(translation_unit
(program
(program_statement
Expand All @@ -228,7 +228,7 @@ index ca8c86e..d6bebae 100644
(enum
(enum_statement
(language_binding
@@ -2711,7 +2711,7 @@ end program test
@@ -2748,7 +2748,7 @@ end program test
(translation_unit
(program
(program_statement
Expand All @@ -237,7 +237,7 @@ index ca8c86e..d6bebae 100644
(allocate_statement
allocation: (sized_allocation
(identifier)
@@ -3499,7 +3499,7 @@ end program
@@ -3536,7 +3536,7 @@ end program
(translation_unit
(program
(program_statement
Expand Down
Loading