ffmt 0.3.1__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ffmt-0.3.1 → ffmt-0.3.4}/Cargo.lock +1 -1
- {ffmt-0.3.1 → ffmt-0.3.4}/Cargo.toml +1 -1
- {ffmt-0.3.1 → ffmt-0.3.4}/PKG-INFO +2 -2
- {ffmt-0.3.1 → ffmt-0.3.4}/README.md +1 -1
- {ffmt-0.3.1 → ffmt-0.3.4}/pyproject.toml +1 -1
- {ffmt-0.3.1 → ffmt-0.3.4}/src/whitespace.rs +47 -2
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/blank_lines.expected.fpp +0 -1
- ffmt-0.3.4/tests/fixtures/blank_lines.input.fpp +11 -0
- ffmt-0.3.4/tests/fixtures/call_block.input.fpp +10 -0
- ffmt-0.3.4/tests/fixtures/directives.input.fpp +17 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/doxygen_spacing.input.fpp +17 -4
- ffmt-0.3.4/tests/fixtures/fypp.input.fpp +31 -0
- ffmt-0.3.4/tests/fixtures/simple.input.fpp +27 -0
- ffmt-0.3.1/tests/fixtures/blank_lines.input.fpp +0 -12
- ffmt-0.3.1/tests/fixtures/call_block.input.fpp +0 -8
- ffmt-0.3.1/tests/fixtures/directives.input.fpp +0 -14
- ffmt-0.3.1/tests/fixtures/fypp.input.fpp +0 -26
- ffmt-0.3.1/tests/fixtures/simple.input.fpp +0 -19
- {ffmt-0.3.1 → ffmt-0.3.4}/.github/workflows/ci.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.github/workflows/release.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.github/workflows/update-readme-version.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.gitignore +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.markdownlint.json +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.pre-commit-hooks.yaml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/.readthedocs.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/LICENSE +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/action.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/ci.md +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/configuration.md +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/editors.md +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/getting-started.md +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/index.md +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/docs/requirements.txt +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/mkdocs.yml +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/align.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/case_norm.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/classifier.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/cli.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/config.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/formatter.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/keyword_norm.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/lib.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/lsp.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/main.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/reader.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/scope.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/src/unicode.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/case_norm.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/classifier.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/config_integration.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/call_block.expected.fpp +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/directives.expected.fpp +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/doxygen_spacing.expected.fpp +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/fypp.expected.fpp +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/fixtures/simple.expected.fpp +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/integration.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/reader.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/scope.rs +0 -0
- {ffmt-0.3.1 → ffmt-0.3.4}/tests/whitespace.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ffmt
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -88,7 +88,7 @@ multdiv = false
|
|
|
88
88
|
# pre-commit
|
|
89
89
|
repos:
|
|
90
90
|
- repo: https://github.com/sbryngelson/ffmt
|
|
91
|
-
rev: v0.3.
|
|
91
|
+
rev: v0.3.3
|
|
92
92
|
hooks:
|
|
93
93
|
- id: ffmt
|
|
94
94
|
```
|
|
@@ -730,6 +730,45 @@ fn is_io_format_star(tokens: &[Token]) -> bool {
|
|
|
730
730
|
false
|
|
731
731
|
}
|
|
732
732
|
|
|
733
|
+
/// Check if a comma at `idx` is inside a slice expression.
|
|
734
|
+
/// A comma is a "slice comma" if either the preceding or following dimension
|
|
735
|
+
/// (at the same paren depth) contains a SliceColon.
|
|
736
|
+
fn is_slice_comma(tokens: &[Token], idx: usize) -> bool {
|
|
737
|
+
// Look backward from idx for a SliceColon at the same nesting level
|
|
738
|
+
let mut depth: i32 = 0;
|
|
739
|
+
for token in tokens[..idx].iter().rev() {
|
|
740
|
+
match token {
|
|
741
|
+
Token::Op(OpKind::CloseParen, _) => depth += 1,
|
|
742
|
+
Token::Op(OpKind::OpenParen, _) => {
|
|
743
|
+
if depth == 0 {
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
depth -= 1;
|
|
747
|
+
}
|
|
748
|
+
Token::Op(OpKind::SliceColon, _) if depth == 0 => return true,
|
|
749
|
+
Token::Op(OpKind::Comma, _) if depth == 0 => break,
|
|
750
|
+
_ => {}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
// Look forward from idx for a SliceColon at the same nesting level
|
|
754
|
+
depth = 0;
|
|
755
|
+
for token in tokens.iter().skip(idx + 1) {
|
|
756
|
+
match token {
|
|
757
|
+
Token::Op(OpKind::OpenParen, _) => depth += 1,
|
|
758
|
+
Token::Op(OpKind::CloseParen, _) => {
|
|
759
|
+
if depth == 0 {
|
|
760
|
+
break;
|
|
761
|
+
}
|
|
762
|
+
depth -= 1;
|
|
763
|
+
}
|
|
764
|
+
Token::Op(OpKind::SliceColon, _) if depth == 0 => return true,
|
|
765
|
+
Token::Op(OpKind::Comma, _) if depth == 0 => break,
|
|
766
|
+
_ => {}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
false
|
|
770
|
+
}
|
|
771
|
+
|
|
733
772
|
fn is_unary_context(tokens: &[Token]) -> bool {
|
|
734
773
|
// Walk backwards, skipping Space tokens
|
|
735
774
|
for token in tokens.iter().rev() {
|
|
@@ -829,12 +868,18 @@ fn render(tokens: &[Token], ws: &WhitespaceConfig) -> String {
|
|
|
829
868
|
out.push_str(op_str);
|
|
830
869
|
}
|
|
831
870
|
}
|
|
832
|
-
// Comma: no space before, configurable space after
|
|
871
|
+
// Comma: no space before, configurable space after.
|
|
872
|
+
// When slice_colon is compact, commas inside slice expressions
|
|
873
|
+
// (adjacent to a SliceColon) also omit the trailing space.
|
|
833
874
|
OpKind::Comma => {
|
|
834
875
|
trim_trailing_space(&mut out);
|
|
835
876
|
out.push_str(op_str);
|
|
836
877
|
if spaced {
|
|
837
|
-
|
|
878
|
+
let in_slice =
|
|
879
|
+
!ws.slice_colon.is_enabled() && is_slice_comma(tokens, idx);
|
|
880
|
+
if !in_slice {
|
|
881
|
+
out.push(' ');
|
|
882
|
+
}
|
|
838
883
|
}
|
|
839
884
|
}
|
|
840
885
|
// Keyword arg = : always no spaces
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
subroutine s_test()
|
|
2
|
+
|
|
3
|
+
integer :: i, j, k
|
|
4
|
+
|
|
5
|
+
#if defined(MFC_OpenACC)
|
|
6
|
+
!$acc parallel loop collapse(3)
|
|
7
|
+
do k = 0, p
|
|
8
|
+
do j = 0, n
|
|
9
|
+
do i = 0, m
|
|
10
|
+
x(i, j, k) = y(i, j, k)*z(i, j, k)
|
|
11
|
+
end do
|
|
12
|
+
end do
|
|
13
|
+
end do
|
|
14
|
+
!$acc end parallel loop
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
end subroutine s_test
|
|
@@ -5,25 +5,38 @@ module m_test
|
|
|
5
5
|
contains
|
|
6
6
|
|
|
7
7
|
subroutine s_first()
|
|
8
|
+
|
|
8
9
|
integer :: x
|
|
10
|
+
|
|
9
11
|
x = 1
|
|
12
|
+
|
|
10
13
|
end subroutine s_first
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
!> @brief Second procedure Does something else
|
|
13
16
|
subroutine s_second()
|
|
17
|
+
|
|
14
18
|
integer :: y
|
|
19
|
+
|
|
15
20
|
y = 2
|
|
21
|
+
|
|
16
22
|
end subroutine s_second
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
|
|
24
|
+
!> Third procedure with a long description that documents what this function does
|
|
19
25
|
function f_third() result(z)
|
|
26
|
+
|
|
20
27
|
integer :: z
|
|
28
|
+
|
|
21
29
|
z = 3
|
|
30
|
+
|
|
22
31
|
end function f_third
|
|
32
|
+
|
|
23
33
|
!> Fourth procedure
|
|
24
34
|
subroutine s_fourth()
|
|
35
|
+
|
|
25
36
|
integer :: w
|
|
37
|
+
|
|
26
38
|
w = 4
|
|
39
|
+
|
|
27
40
|
end subroutine s_fourth
|
|
28
41
|
|
|
29
42
|
end module m_test
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#:include 'macros.fpp'
|
|
2
|
+
module m_fypp_test
|
|
3
|
+
|
|
4
|
+
implicit none
|
|
5
|
+
|
|
6
|
+
contains
|
|
7
|
+
subroutine s_test()
|
|
8
|
+
|
|
9
|
+
#:if defined('MFC_OpenACC')
|
|
10
|
+
$:GPU_PARALLEL_LOOP(collapse=3)
|
|
11
|
+
do k = 0, p
|
|
12
|
+
do j = 0, n
|
|
13
|
+
do i = 0, m
|
|
14
|
+
x(i, j, k) = 0.0_wp
|
|
15
|
+
end do
|
|
16
|
+
end do
|
|
17
|
+
end do
|
|
18
|
+
$:END_GPU_PARALLEL_LOOP()
|
|
19
|
+
#:else
|
|
20
|
+
do k = 0, p
|
|
21
|
+
do j = 0, n
|
|
22
|
+
do i = 0, m
|
|
23
|
+
x(i, j, k) = 0.0_wp
|
|
24
|
+
end do
|
|
25
|
+
end do
|
|
26
|
+
end do
|
|
27
|
+
#:endif
|
|
28
|
+
|
|
29
|
+
end subroutine s_test
|
|
30
|
+
|
|
31
|
+
end module m_fypp_test
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module m_test
|
|
2
|
+
|
|
3
|
+
use m_types
|
|
4
|
+
|
|
5
|
+
implicit none
|
|
6
|
+
|
|
7
|
+
private; public :: s_foo
|
|
8
|
+
integer :: x
|
|
9
|
+
real :: y
|
|
10
|
+
|
|
11
|
+
contains
|
|
12
|
+
subroutine s_foo(a, b)
|
|
13
|
+
|
|
14
|
+
integer, intent(in) :: a, b
|
|
15
|
+
|
|
16
|
+
if (a == b)then
|
|
17
|
+
x = a + b
|
|
18
|
+
else
|
|
19
|
+
x = a - b
|
|
20
|
+
end if
|
|
21
|
+
do i = 1, n
|
|
22
|
+
y = y + x
|
|
23
|
+
end do
|
|
24
|
+
|
|
25
|
+
end subroutine s_foo
|
|
26
|
+
|
|
27
|
+
end module m_test
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#:include 'macros.fpp'
|
|
2
|
-
MODULE m_fypp_test
|
|
3
|
-
IMPLICIT NONE
|
|
4
|
-
CONTAINS
|
|
5
|
-
SUBROUTINE s_test()
|
|
6
|
-
#:if defined('MFC_OpenACC')
|
|
7
|
-
$:GPU_PARALLEL_LOOP(collapse=3)
|
|
8
|
-
DO k=0,p
|
|
9
|
-
DO j=0,n
|
|
10
|
-
DO i=0,m
|
|
11
|
-
x(i,j,k)=0.0_wp
|
|
12
|
-
END DO
|
|
13
|
-
END DO
|
|
14
|
-
END DO
|
|
15
|
-
$:END_GPU_PARALLEL_LOOP()
|
|
16
|
-
#:else
|
|
17
|
-
DO k=0,p
|
|
18
|
-
DO j=0,n
|
|
19
|
-
DO i=0,m
|
|
20
|
-
x(i,j,k)=0.0_wp
|
|
21
|
-
END DO
|
|
22
|
-
END DO
|
|
23
|
-
END DO
|
|
24
|
-
#:endif
|
|
25
|
-
END SUBROUTINE s_test
|
|
26
|
-
END MODULE m_fypp_test
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
MODULE m_test
|
|
2
|
-
USE m_types
|
|
3
|
-
IMPLICIT NONE
|
|
4
|
-
private;public :: s_foo
|
|
5
|
-
INTEGER::x
|
|
6
|
-
REAL :: y
|
|
7
|
-
CONTAINS
|
|
8
|
-
SUBROUTINE s_foo(a,b)
|
|
9
|
-
INTEGER,INTENT(IN)::a,b
|
|
10
|
-
IF(a==b)THEN
|
|
11
|
-
x=a+b
|
|
12
|
-
ELSE
|
|
13
|
-
x=a-b
|
|
14
|
-
END IF
|
|
15
|
-
DO i=1,n
|
|
16
|
-
y=y+x
|
|
17
|
-
END DO
|
|
18
|
-
END SUBROUTINE s_foo
|
|
19
|
-
END MODULE m_test
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|