Skip to content

Commit a6f0747

Browse files
han190gnikit
authored andcommitted
Add testing file; fix fail image statement
1 parent 876e33c commit a6f0747

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

syntaxes/fortran_free-form.tmLanguage.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,11 +2877,11 @@
28772877
},
28782878
"sync-all-statement": {
28792879
"comment": "Introduced in the Fortran 2018 standard.",
2880-
"name": "meta.statement.sync-all.fortran",
2881-
"begin": "(?i)\\b(sync all)(\\s*(?=\\())?",
2880+
"name": "meta.statement.sync-all-memory.fortran",
2881+
"begin": "(?i)\\b(sync all|sync memory)(\\s*(?=\\())?",
28822882
"beginCaptures": {
28832883
"1": {
2884-
"name": "keyword.control.sync-all.fortran"
2884+
"name": "keyword.control.sync-all-memory.fortran"
28852885
},
28862886
"2": {
28872887
"name": "punctuation.parentheses.left.fortran"
@@ -2901,11 +2901,11 @@
29012901
},
29022902
"sync-statement": {
29032903
"comment": "Introduced in the Fortran 2018 standard.",
2904-
"name": "meta.statement.sync.fortran",
2905-
"begin": "(?i)\\b(sync images|sync memory|sync team)\\s*(?=\\()",
2904+
"name": "meta.statement.sync-images-team.fortran",
2905+
"begin": "(?i)\\b(sync images|sync team)\\s*(?=\\()",
29062906
"beginCaptures": {
29072907
"1": {
2908-
"name": "keyword.control.sync.fortran"
2908+
"name": "keyword.control.sync-images-team.fortran"
29092909
},
29102910
"2": {
29112911
"name": "punctuation.parentheses.left.fortran"
@@ -2974,8 +2974,8 @@
29742974
"fail-image-statement": {
29752975
"comment": "Introduced in the Fortran 2018 standard.",
29762976
"name": "meta.statement.fail-image.fortran",
2977-
"begin": "(fail image)",
2978-
"beginCaptures": {
2977+
"match": "\\b(fail image)\\b",
2978+
"captures": {
29792979
"1": {
29802980
"name": "keyword.control.fail-image.fortran"
29812981
}

test/fortran/syntax/images.f90

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
program main
2+
3+
use iso_fortran_env, only: team_type, event_type
4+
implicit none
5+
6+
type(team_type) :: team
7+
type(event_type) :: event[*]
8+
integer :: image_index, team_index
9+
integer :: status
10+
11+
image_index = this_image()
12+
team_index = merge(1, 2, mod(image_index, 2) == 0)
13+
14+
!> Test form team
15+
form team (team_index, team)
16+
17+
! Test fail image
18+
if (team_index == 1) fail image
19+
20+
!> Test sync all, sync memory
21+
sync all
22+
sync all (stat=status)
23+
sync memory
24+
sync memory (stat=status)
25+
26+
!> Test sync team, sync images
27+
sync team (team_index)
28+
sync team (team_index, stat=status)
29+
sync images (image_index)
30+
sync images (image_index, stat=status)
31+
32+
!> Test event post and event wait
33+
event post (event[1])
34+
event post (event[2])
35+
event wait (event, until_count=2)
36+
37+
end program main

0 commit comments

Comments
 (0)