File: separate_compilation_23a.f90

package info (click to toggle)
lfortran 0.60.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,416 kB
  • sloc: cpp: 173,406; f90: 80,491; python: 17,586; ansic: 9,610; yacc: 2,356; sh: 1,401; fortran: 895; makefile: 38; javascript: 15
file content (51 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module string_type_separate_compilation_23
    implicit none
    private

    public :: string_type
    public :: operator(//)

    type :: string_type
        sequence
        private
        character(len=:), allocatable :: raw
    end type string_type

    interface operator(//)
        module procedure :: concat_string_string
    end interface operator(//)

contains

    elemental function concat_string_string(lhs, rhs) result(string)
        type(string_type), intent(in) :: lhs
        type(string_type), intent(in) :: rhs
        type(string_type) :: string
    end function concat_string_string

end module string_type_separate_compilation_23


module ansi_separate_compilation_23
    implicit none
    private

    public :: ansi_code
    public :: operator(//)

    type :: ansi_code
        private
        integer(1) :: style = -1
        integer(1) :: bg = -1
        integer(1) :: fg = -1
    end type ansi_code

    interface operator(//)
        pure module function concat_left(lval, code) result(str)
            character(len=*), intent(in) :: lval
            type(ansi_code), intent(in) :: code
            character(len=:), allocatable :: str
        end function concat_left
    end interface operator(//)

end module ansi_separate_compilation_23