Skip to content

Commit

Permalink
Merge pull request #369 from mstreeter10/udb
Browse files Browse the repository at this point in the history
udb: Srcfile fail on lookup if src file not available
  • Loading branch information
Jafaral authored Mar 4, 2024
2 parents e407e17 + 9122251 commit 6b27391
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions uni/udb/srcfile.icn
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,15 @@ end
#
method getFileTotalLines(fname)
/fname := keyword("file", MONITORED) | procMainFile
if not member(fileText, fname) then fail
if lines := *(\fileText[fname]) then return lines
end

#
# returns an image of the current source line
#
method getSrcLine(filename, lineno)
if not member(fileText, \filename) then fail
if \(code := fileText[\filename][\lineno]) then return code
end

Expand All @@ -644,6 +646,7 @@ method getSrcCode(fname)
local text, line, code := []

if /fname then fname := keyword("file", MONITORED)
if not member(fileText, fname) then fail

if \(text := fileText[fname]) then {
every line := 1 to *text do
Expand Down

0 comments on commit 6b27391

Please sign in to comment.