Skip to content

Commit ead3440

Browse files
committed
Mv src/examples to example
2 parents 9794b86 + 6b2b5d2 commit ead3440

File tree

279 files changed

+226
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+226
-227
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ add_subdirectory(src)
7171
if(BUILD_TESTING)
7272
enable_testing()
7373
add_subdirectory(test)
74+
add_subdirectory(example)
7475
endif()
7576

7677
install(EXPORT ${PROJECT_NAME}-targets

ci/fpm-deployment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ find src -maxdepth 1 -iname "*.fypp" \
4949
find src -maxdepth 1 -iname "*.f90" -exec cp {} "$destdir/src/" \;
5050
find test -name "test_*.f90" -exec cp {} "$destdir/test/" \;
5151
find test -name "*.dat" -exec cp {} "$destdir/" \;
52-
find src/examples -name "example_*.f90" -exec cp {} "$destdir/example/" \;
52+
find example -name "example_*.f90" -exec cp {} "$destdir/example/" \;
5353

5454
# Include additional files
5555
cp "${include[@]}" "$destdir/"

doc/specs/stdlib_array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Returns an array of default integer size, with a maximum length of `size(array)`
4646
#### Examples
4747

4848
```fortran
49-
{!src/examples/array/example_trueloc.f90!}
49+
{!example/array/example_trueloc.f90!}
5050
```
5151

5252

@@ -83,5 +83,5 @@ Returns an array of default integer size, with a maximum length of `size(array)`
8383
#### Examples
8484

8585
```fortran
86-
{!src/examples/array/example_falseloc.f90!}
86+
{!example/array/example_falseloc.f90!}
8787
```

doc/specs/stdlib_ascii.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The result is an intrinsic character type of the same length as `string`.
5151
#### Example
5252

5353
```fortran
54-
{!src/examples/ascii/example_ascii_to_lower.f90!}
54+
{!example/ascii/example_ascii_to_lower.f90!}
5555
```
5656

5757
### `to_upper`
@@ -83,7 +83,7 @@ The result is an intrinsic character type of the same length as `string`.
8383
#### Example
8484

8585
```fortran
86-
{!src/examples/ascii/example_ascii_to_upper.f90!}
86+
{!example/ascii/example_ascii_to_upper.f90!}
8787
```
8888

8989
### `to_title`
@@ -120,7 +120,7 @@ The result is an intrinsic character type of the same length as `string`.
120120
#### Example
121121

122122
```fortran
123-
{!src/examples/ascii/example_ascii_to_title.f90!}
123+
{!example/ascii/example_ascii_to_title.f90!}
124124
```
125125

126126
### `to_sentence`
@@ -155,7 +155,7 @@ The result is an intrinsic character type of the same length as `string`.
155155
#### Example
156156

157157
```fortran
158-
{!src/examples/ascii/example_ascii_to_sentence.f90!}
158+
{!example/ascii/example_ascii_to_sentence.f90!}
159159
```
160160

161161
### `reverse`
@@ -187,5 +187,5 @@ The result is an intrinsic character type of the same length as `string`.
187187
#### Example
188188

189189
```fortran
190-
{!src/examples/ascii/example_ascii_reverse.f90!}
190+
{!example/ascii/example_ascii_reverse.f90!}
191191
```

doc/specs/stdlib_bitsets.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ is mapped to a set bit, and `.false.` is mapped to an unset bit.
205205
#### Example
206206

207207
```fortran
208-
{!src/examples/bitsets/example_bitsets_assignment.f90!}
208+
{!example/bitsets/example_bitsets_assignment.f90!}
209209
```
210210

211211
### Table of the non-member comparison operations
@@ -259,7 +259,7 @@ otherwise it is `.false.`.
259259
#### Example
260260

261261
```fortran
262-
{!src/examples/bitsets/example_bitsets_all.f90!}
262+
{!example/bitsets/example_bitsets_all.f90!}
263263
```
264264

265265
### `and` - bitwise `and` of the bits of two bitsets
@@ -296,7 +296,7 @@ number of bits as `set1`.
296296
#### Example
297297

298298
```fortran
299-
{!src/examples/bitsets/example_bitsets_and.f90!}
299+
{!example/bitsets/example_bitsets_and.f90!}
300300
```
301301

302302
### `and_not` - Bitwise `and` of one bitset with the negation of another
@@ -334,7 +334,7 @@ number of bits as `set1`, otherwise the result is undefined.
334334
#### Example
335335

336336
```fortran
337-
{!src/examples/bitsets/example_bitsets_and_not.f90!}
337+
{!example/bitsets/example_bitsets_and_not.f90!}
338338
```
339339

340340
### `any` - determine whether any bits are set
@@ -368,7 +368,7 @@ is `.false.`.
368368
#### Example
369369

370370
```fortran
371-
{!src/examples/bitsets/example_bitsets_any.f90!}
371+
{!example/bitsets/example_bitsets_any.f90!}
372372
```
373373

374374
### `bit_count` - return the number of bits that are set
@@ -402,7 +402,7 @@ equal to the number of bits that are set in `self`.
402402
#### Example
403403

404404
```fortran
405-
{!src/examples/bitsets/example_bitsets_bit_count.f90!}
405+
{!example/bitsets/example_bitsets_bit_count.f90!}
406406
```
407407

408408
#### `bits` - returns the number of bits
@@ -436,7 +436,7 @@ the number of defined bits in `self`.
436436
#### Example
437437

438438
```fortran
439-
{!src/examples/bitsets/example_bitsets_bits.f90!}
439+
{!example/bitsets/example_bitsets_bits.f90!}
440440
```
441441

442442
### `clear` - clears a sequence of one or more bits
@@ -487,7 +487,7 @@ an `intent(in)` argument.
487487
#### Example
488488

489489
```fortran
490-
{!src/examples/bitsets/example_bitsets_clear.f90!}
490+
{!example/bitsets/example_bitsets_clear.f90!}
491491
```
492492

493493
### `extract` - create a new bitset from a range in an old bitset
@@ -538,7 +538,7 @@ an `intent(out)` argument. If present it shall have one of the values:
538538
#### Example
539539

540540
```fortran
541-
{!src/examples/bitsets/example_bitsets_extract.f90!}
541+
{!example/bitsets/example_bitsets_extract.f90!}
542542
```
543543

544544
### `flip` - flip the values of a sequence of one or more bits
@@ -590,7 +590,7 @@ an `intent(in)` argument.
590590
#### Example
591591

592592
```fortran
593-
{!src/examples/bitsets/example_bitsets_flip.f90!}
593+
{!example/bitsets/example_bitsets_flip.f90!}
594594
```
595595

596596
### `from_string` - initializes a bitset from a binary literal
@@ -640,7 +640,7 @@ codes:
640640
#### Example
641641

642642
```fortran
643-
{!src/examples/bitsets/example_bitsets_from_string.f90!}
643+
{!example/bitsets/example_bitsets_from_string.f90!}
644644
```
645645

646646
### `init` - `bitset_type` initialization routines
@@ -689,7 +689,7 @@ stop code. It can have any of the following error codes:
689689
#### Example
690690

691691
```fortran
692-
{!src/examples/bitsets/example_bitsets_init.f90!}
692+
{!example/bitsets/example_bitsets_init.f90!}
693693
```
694694

695695
### `input` - reads a bitset from an unformatted file
@@ -742,7 +742,7 @@ values for this `status` are:
742742
#### Example
743743

744744
```fortran
745-
{!src/examples/bitsets/example_bitsets_input.f90!}
745+
{!example/bitsets/example_bitsets_input.f90!}
746746
```
747747

748748
### `none` - determines whether no bits are set
@@ -777,7 +777,7 @@ The result is `.true.` if no bits in `self` are set, otherwise it is
777777
#### Example
778778

779779
```fortran
780-
{!src/examples/bitsets/example_bitsets_none.f90!}
780+
{!example/bitsets/example_bitsets_none.f90!}
781781
```
782782

783783
### `not` - Performs the logical complement on a bitset
@@ -807,7 +807,7 @@ complement of their values on input.
807807
#### Example
808808

809809
```fortran
810-
{!src/examples/bitsets/example_bitsets_not.f90!}
810+
{!example/bitsets/example_bitsets_not.f90!}
811811
```
812812

813813
### `or` - Bitwise OR of the bits of two bitsets
@@ -844,7 +844,7 @@ otherwise the results are undefined.
844844
#### Example
845845

846846
```fortran
847-
{!src/examples/bitsets/example_bitsets_or.f90!}
847+
{!example/bitsets/example_bitsets_or.f90!}
848848
```
849849

850850
### `output` - Writes a binary representation of a bitset to a file
@@ -887,7 +887,7 @@ code. The two code values have the meaning:
887887
#### Example
888888

889889
```fortran
890-
{!src/examples/bitsets/example_bitsets_output.f90!}
890+
{!example/bitsets/example_bitsets_output.f90!}
891891
```
892892

893893
### `read_bitset` - initializes `self` with the value of a *bitset_literal*
@@ -968,7 +968,7 @@ as its error code. The possible error codes are:
968968
#### Example
969969

970970
```fortran
971-
{!src/examples/bitsets/example_bitsets_read_bitset.f90!}
971+
{!example/bitsets/example_bitsets_read_bitset.f90!}
972972
```
973973

974974
### `set` - sets a sequence of one or more bits to 1
@@ -1022,7 +1022,7 @@ Elemental subroutine
10221022
#### Example
10231023

10241024
```fortran
1025-
{!src/examples/bitsets/example_bitsets_set.f90!}
1025+
{!example/bitsets/example_bitsets_set.f90!}
10261026
```
10271027

10281028
### `test` - determine whether a bit is set
@@ -1062,7 +1062,7 @@ otherwise it is `.false.`. If `pos` is outside the range
10621062
#### Example
10631063

10641064
```fortran
1065-
{!src/examples/bitsets/example_bitsets_test.f90!}
1065+
{!example/bitsets/example_bitsets_test.f90!}
10661066
```
10671067

10681068
### `to_string` - represent a bitset as a binary literal
@@ -1106,7 +1106,7 @@ the stop code. The values have the following meanings:
11061106
#### Example
11071107

11081108
```fortran
1109-
{!src/examples/bitsets/example_bitsets_to_string.f90!}
1109+
{!example/bitsets/example_bitsets_to_string.f90!}
11101110
```
11111111

11121112
### `value` - determine the value of a bit
@@ -1145,7 +1145,7 @@ is zero.
11451145
#### Example
11461146

11471147
```fortran
1148-
{!src/examples/bitsets/example_bitsets_value.f90!}
1148+
{!example/bitsets/example_bitsets_value.f90!}
11491149
```
11501150

11511151
### `write_bitset` - writes a *bitset-literal*
@@ -1212,7 +1212,7 @@ the following error code values:
12121212
#### Example
12131213

12141214
```fortran
1215-
{!src/examples/bitsets/example_bitsets_write_bitset.f90!}
1215+
{!example/bitsets/example_bitsets_write_bitset.f90!}
12161216
```
12171217

12181218
### `xor` - bitwise exclusive `or`
@@ -1249,7 +1249,7 @@ samee number of bits, otherwise the result is undefined.
12491249
#### Example
12501250

12511251
```fortran
1252-
{!src/examples/bitsets/example_bitsets_xor.f90!}
1252+
{!example/bitsets/example_bitsets_xor.f90!}
12531253
```
12541254

12551255
## Specification of the `stdlib_bitsets` operators
@@ -1295,7 +1295,7 @@ to the same value, otherwise the result is `.false.`.
12951295
#### Example
12961296

12971297
```fortran
1298-
{!src/examples/bitsets/example_bitsets_equality.f90!}
1298+
{!example/bitsets/example_bitsets_equality.f90!}
12991299
```
13001300

13011301
### `/=` - compare two bitsets to determine whether any bits differ in value
@@ -1339,7 +1339,7 @@ the result is `.false.`.
13391339
#### Example
13401340

13411341
```fortran
1342-
{!src/examples/bitsets/example_bitsets_inequality.f90!}
1342+
{!example/bitsets/example_bitsets_inequality.f90!}
13431343
```
13441344

13451345
### `>=` - compare two bitsets to determine whether the first is greater than or equal to the second
@@ -1386,7 +1386,7 @@ or the highest order different bit is set to 1 in `set1` and to 0 in
13861386
#### Example
13871387

13881388
```fortran
1389-
{!src/examples/bitsets/example_bitsets_ge.f90!}
1389+
{!example/bitsets/example_bitsets_ge.f90!}
13901390
```
13911391

13921392
### `>` - compare two bitsets to determine whether the first is greater than the other
@@ -1433,7 +1433,7 @@ highest order different bit is set to 1 in `set1` and to 0 in `set2`,
14331433
#### Example
14341434

14351435
```fortran
1436-
{!src/examples/bitsets/example_bitsets_gt.f90!}
1436+
{!example/bitsets/example_bitsets_gt.f90!}
14371437
```
14381438

14391439
### `<=` - compare two bitsets to determine whether the first is less than or equal to the other
@@ -1480,7 +1480,7 @@ or the highest order different bit is set to 0 in `set1` and to 1 in
14801480
#### Example
14811481

14821482
```fortran
1483-
{!src/examples/bitsets/example_bitsets_le.f90!}
1483+
{!example/bitsets/example_bitsets_le.f90!}
14841484
```
14851485

14861486
### `<` - compare two bitsets to determine whether the first is less than the other
@@ -1527,5 +1527,5 @@ highest order different bit is set to 0 in `set1` and to 1 in `set2`,
15271527
#### Example
15281528

15291529
```fortran
1530-
{!src/examples/bitsets/example_bitsets_lt.f90!}
1530+
{!example/bitsets/example_bitsets_lt.f90!}
15311531
```

doc/specs/stdlib_error.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ If `condition` is `.false.`, and:
5353
#### Examples
5454

5555
```fortran
56-
{!src/examples/error/example_check1.f90!}
56+
{!example/error/example_check1.f90!}
5757
```
5858
```fortran
59-
{!src/examples/error/example_check2.f90!}
59+
{!example/error/example_check2.f90!}
6060
```
6161
```fortran
62-
{!src/examples/error/example_check3.f90!}
62+
{!example/error/example_check3.f90!}
6363
```
6464
```fortran
65-
{!src/examples/error/example_check4.f90!}
65+
{!example/error/example_check4.f90!}
6666
```
6767

6868
### `error_stop` - aborts the program
@@ -94,11 +94,11 @@ Aborts the program with printing the message `msg` to `stderr` and a nonzero exi
9494
Without error code:
9595

9696
```fortran
97-
{!src/examples/error/example_error_stop1.f90!}
97+
{!example/error/example_error_stop1.f90!}
9898
```
9999

100100
With error code:
101101

102102
```fortran
103-
{!src/examples/error/example_error_stop2.f90!}
103+
{!example/error/example_error_stop2.f90!}
104104
```

0 commit comments

Comments
 (0)