ftnlf

Check-in [f5dfc99988]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix error in diagnostics.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f5dfc999880d56795c0651bbd9ca8b0b9227a69f
User & Date: vadim 2018-05-22 08:53:53
Context
2018-05-22
08:54
Cleanup. check-in: ddd58d65b7 user: vadim tags: trunk
08:53
Fix error in diagnostics. check-in: f5dfc99988 user: vadim tags: trunk
2018-05-21
11:37
Allocate zero-length FA once and store it as upvalue. check-in: 44d39185ec user: vadim tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ftnlf.f90.

610
611
612
613
614
615
616

617
618
619
620
621
622
623
...
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705

        ! Stack is now:
        ! UM key val arg1 ... argn UI
        ! < DEBUG >
        call luaFE_check(L, lua_gettop(L) == na+4, 'stack inconsistency')

        ! classify value and call it

        if (typ == LUA_TNUMBER) then
            ! Constant
            if (ckarg(nv == 1 .and. oflag == 0, &
                & 'Too many output arguments for constant ') /= 0) return
            ! Pop input userdata and arguments
            call lua_pop(L, na+1)
            ! stack is now: UM key val
................................................................................
        end if

    contains
        function ckarg(cond, msg) result(r)
            integer(4) :: r
            logical, intent(in) :: cond
            character(*), intent(in) :: msg
            integer(4), parameter :: ix_key = 3
            if (cond) then
                r = 0
            else
                call lua_pushstring_f(L, msg)
                call lua_pushvalue(L, ix_key)
                call lua_concat(L, 2)
                r = lua_error(L)
            end if
        end function ckarg
    end function lfun_tail

end module ftnlf







>







 







|












610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
...
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706

        ! Stack is now:
        ! UM key val arg1 ... argn UI
        ! < DEBUG >
        call luaFE_check(L, lua_gettop(L) == na+4, 'stack inconsistency')

        ! classify value and call it
print *,'XX: ', typ
        if (typ == LUA_TNUMBER) then
            ! Constant
            if (ckarg(nv == 1 .and. oflag == 0, &
                & 'Too many output arguments for constant ') /= 0) return
            ! Pop input userdata and arguments
            call lua_pop(L, na+1)
            ! stack is now: UM key val
................................................................................
        end if

    contains
        function ckarg(cond, msg) result(r)
            integer(4) :: r
            logical, intent(in) :: cond
            character(*), intent(in) :: msg
            integer(4), parameter :: ix_key = 2
            if (cond) then
                r = 0
            else
                call lua_pushstring_f(L, msg)
                call lua_pushvalue(L, ix_key)
                call lua_concat(L, 2)
                r = lua_error(L)
            end if
        end function ckarg
    end function lfun_tail

end module ftnlf