[comment:! Based on code samples from https://en.wikipedia.org/wiki/Fortran]
[comment:! and https://learnxinyminutes.com/docs/fortran95/.]

[module:MODULE] [variable:strings]
    [type:TYPE] [type:string80]            [comment:! a derived type with a trailing comment]
        [type:INTEGER] [punctuation.delimiter:::] [variable:length]
        [type:CHARACTER][punctuation.bracket:(][number:80][punctuation.bracket:)] [punctuation.delimiter:::] [variable:value]
    [keyword:END TYPE string80]
[keyword:END MODULE] [variable:strings]

[keyword:PROGRAM] [variable:test]
    [keyword:USE] [variable:strings]
    [keyword:IMPLICIT] [attribute:NONE]

    [type:CHARACTER] [punctuation.delimiter:::] [variable:char1][punctuation.delimiter:,] [variable:char2][punctuation.delimiter:,] [variable:char3]
    [type:TYPE][punctuation.bracket:(][type:string80][punctuation.bracket:)] [punctuation.delimiter:::] [variable:str1][punctuation.delimiter:,] [variable:str2][punctuation.delimiter:,] [variable:str3]
    [type:REAL][punctuation.delimiter:,] [attribute:DIMENSION][punctuation.bracket:(][number:10][punctuation.delimiter:,] [number:20][punctuation.bracket:)] [punctuation.delimiter:::] [variable:a][punctuation.delimiter:,] [variable:b][punctuation.delimiter:,] [variable:c]
    [type:REAL][punctuation.delimiter:,] [attribute:DIMENSION][punctuation.bracket:(][number:5][punctuation.bracket:)] [punctuation.delimiter:::] [variable:v][punctuation.delimiter:,] [variable:w]
    [type:LOGICAL] [punctuation.delimiter:::] [variable:flag][punctuation.bracket:(][number:10][punctuation.delimiter:,] [number:20][punctuation.bracket:)]
    [type:INTEGER] [punctuation.delimiter:::] [variable:i][punctuation.delimiter:,] [variable:j]

    [keyword:CALL] [function:print_message]

    [comment:! Logical literals and relational operators]
    [variable:flag] [operator:=] [boolean:.true.] [operator:.AND.] [boolean:.FALSE.]
    [variable:flag] [operator:=] [variable:a] [operator:<] [variable:b] [operator:.AND.] [variable:i] [operator:/=] [variable:j]
    [variable:flag] [operator:=] [variable:a] [operator:==] [variable:b]

    [keyword:PRINT] [string:"(F6.3)"][punctuation.delimiter:,] [number:4.32]

    [comment:! Array assignments and sections]
    [variable:a] [operator:=] [variable:b]
    [variable:c] [operator:=] [variable:a][operator:/][variable:b]
    [variable:w] [operator:=] [variable:v] [operator:+] [number:1.2]
    [variable:w] [operator:=] [number:5][operator:/][variable:v] [operator:+] [variable:a][punctuation.bracket:(][number:1][punctuation.delimiter::][number:5][punctuation.delimiter:,] [number:5][punctuation.bracket:)]
    [variable:c][punctuation.bracket:(][number:1][punctuation.delimiter::][number:8][punctuation.delimiter:,] [number:5][punctuation.delimiter::][number:10][punctuation.bracket:)] [operator:=] [variable:a][punctuation.bracket:(][number:2][punctuation.delimiter::][number:9][punctuation.delimiter:,] [number:5][punctuation.delimiter::][number:10][punctuation.bracket:)] [operator:+] [variable:b][punctuation.bracket:(][number:1][punctuation.delimiter::][number:8][punctuation.delimiter:,] [number:15][punctuation.delimiter::][number:20][punctuation.bracket:)]
    [variable:v][punctuation.bracket:(][number:2][punctuation.delimiter::][number:5][punctuation.bracket:)] [operator:=] [variable:v][punctuation.bracket:(][number:1][punctuation.delimiter::][number:4][punctuation.bracket:)]

    [variable:i] [operator:=] [number:10]
    [keyword:SELECT] [keyword:CASE] [punctuation.bracket:(][variable:i][punctuation.bracket:)]
        [keyword:CASE] [punctuation.bracket:(][number:0][punctuation.bracket:)] [comment:! case i == 0]
        [variable:j] [operator:=] [number:0]
        [keyword:CASE] [punctuation.bracket:(][number:1][punctuation.delimiter::][number:5][punctuation.bracket:)]
        [variable:j] [operator:=] [number:1]
        [keyword:CASE] [punctuation.bracket:(][number:6][punctuation.delimiter::][punctuation.bracket:)]
        [variable:j] [operator:=] [number:2]
        [keyword:CASE] [keyword:DEFAULT]
        [variable:j] [operator:=] [number:3]
    [keyword:END SELECT]
[keyword:END PROGRAM] [variable:test]

[keyword:SUBROUTINE] [function:print_message]
    [keyword:PRINT] [operator:*][punctuation.delimiter:,] [string:'Hello world!']
[keyword:END SUBROUTINE] [function:print_message]
