Skip to content

Commit c47f295

Browse files
committed
Fix unidoc crash when typing in initially empty doc
1 parent 80b562a commit c47f295

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

uni/unidoc/UniAll.icn

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class UniAll : Object (files, packages,
388388
method processPackage(f)
389389
local pName
390390

391-
pName := getName(f.nextToken())
391+
pName := getName(f.nextToken()) | fail
392392
/packages[pName] := UPackage(pName, curFile)
393393
curPackage := packages[pName]
394394
curPackage.mergeComments(curComments)
@@ -405,7 +405,7 @@ class UniAll : Object (files, packages,
405405
method processImport(f)
406406
local iName, iList, imp, token, sawComma
407407

408-
iName := getName(f.nextToken())
408+
iName := getName(f.nextToken()) | fail
409409
iList := iName
410410
insert(importSet, iName) # Remember for later processing
411411
imp := UImport(iName, curFile, curComments)
@@ -444,7 +444,7 @@ class UniAll : Object (files, packages,
444444
method processLink(f)
445445
local lName, lList, lnk, token, sawComma
446446

447-
lName := getName(f.nextToken())
447+
lName := getName(f.nextToken()) | fail
448448
lList := lName
449449
lName := delSuffix(lName, ".icn")||".icn"
450450
insert(linkSet, lName) # Remember for later processing
@@ -485,7 +485,7 @@ class UniAll : Object (files, packages,
485485
method processClass(f)
486486
local cName, const, scList, token, scName, pList, field
487487

488-
cName := getName(f.nextToken())
488+
cName := getName(f.nextToken()) | fail
489489
curClass := UClass(cName, curFile, curComments)
490490
addTag(curClass)
491491

@@ -667,8 +667,8 @@ class UniAll : Object (files, packages,
667667
# <i>This is intended for internal use only!</i>
668668
method processMethod(f)
669669
local mName, pList, met, token, param
670-
671-
mName := getName(f.nextToken())
670+
if /curClass then fail
671+
mName := getName(f.nextToken()) | fail
672672
pList := ""
673673
met := UMethod(mName, curClass, curComments)
674674
addTag(met)
@@ -721,7 +721,7 @@ class UniAll : Object (files, packages,
721721
method processProcedure(f)
722722
local pName, pList, proced, token, param
723723

724-
pName := getName(f.nextToken())
724+
pName := getName(f.nextToken()) | fail
725725
pList := ""
726726
proced := UProc(pName, curFile, curComments)
727727
addTag(proced)
@@ -775,7 +775,7 @@ class UniAll : Object (files, packages,
775775
local gName, gList, glob, token, sawComma
776776
gList := ""
777777

778-
glob := getGlobal(f, f.nextToken(), curFile, curComments)
778+
glob := getGlobal(f, f.nextToken(), curFile, curComments) | fail
779779
gList ||:= " " || glob.getName()
780780
curComments := Comments()
781781
while not f.EOS() do {
@@ -808,7 +808,7 @@ class UniAll : Object (files, packages,
808808
method processRecord(f)
809809
local rName, pList, rec, token, field
810810

811-
rName := getName(f.nextToken())
811+
rName := getName(f.nextToken()) | fail
812812
pList := ""
813813
rec := URecord(rName, curFile, curComments)
814814
addTag(rec)

0 commit comments

Comments
 (0)