aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-30 15:58:10 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-30 15:58:10 +0000
commitce064a60f567c2938290d02f2de56abbeff17b57 (patch)
treeff2e4ea72230bf3bee19ff32a83fe2a06a00f0af /src/interp
parentfcc96dd42a7374ad2fb44b16fa7198df4aeec8b8 (diff)
downloadopen-axiom-ce064a60f567c2938290d02f2de56abbeff17b57.tar.gz
Add DB parameter to ducmentation functions.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-doc.boot5
-rw-r--r--src/interp/lisplib.boot31
2 files changed, 26 insertions, 10 deletions
diff --git a/src/interp/c-doc.boot b/src/interp/c-doc.boot
index dc4868db..5c87a1ed 100644
--- a/src/interp/c-doc.boot
+++ b/src/interp/c-doc.boot
@@ -136,7 +136,8 @@ collectAndDeleteAssoc x ==
y.rest := s
res
-finalizeDocumentation ctor ==
+finalizeDocumentation db ==
+ ctor := dbConstructor db
unusedCommentLineNumbers := [x for (x := [n,:r]) in $COMBLOCKLIST | r]
docList := substitute("$","%",transDocList($op,$docList))
if u := [sig for [sig,:doc] in docList | null doc] then
@@ -178,7 +179,7 @@ finalizeDocumentation ctor ==
sayKeyedMsg("S2CD0006",[strconc(toString bigcnt,'"."),ctor])
for [n,r] in unusedCommentLineNumbers repeat
sayMSG ['" ",:bright n,'" ",r]
- form := dbConstructorForm constructorDB ctor
+ form := dbConstructorForm db
hn [[:fn(sig,$e,form.args),:doc] for [sig,:doc] in docList] where
fn(x,e,args) ==
x isnt [.,:.] => [x,nil]
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index b6924f39..74e54194 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -409,7 +409,7 @@ compDefineLisplib(db,df:=["DEF",[op,:.],:.],m,e,fal,fn) ==
libName := dbAbbreviation db
if dbSourceFile db = nil then
dbSourceFile(db) := namestring $editFile
- $compileDocumentation => compileDocumentation(op,libName)
+ $compileDocumentation => compileDocumentation(db,libName)
sayMSG ['" initializing ",$spadLibFT,:bright libName,
'"for",:bright op]
initializeLisplib(db,libName)
@@ -433,11 +433,11 @@ compDefineLisplib(db,df:=["DEF",[op,:.],:.],m,e,fal,fn) ==
$newConlist := [op, :$newConlist] ----------> bound in function "compiler"
res
-compileDocumentation(ctor,libName) ==
- filename := makeInputFilename(libName,$spadLibFT)
+compileDocumentation(db,libName) ==
+ filename := libDirname dbLibstream db
$FCOPY(filename,[libName,'DOCLB])
stream := RDEFIOSTREAM [['FILE,libName,'DOCLB],['MODE, :'O]]
- lisplibWrite('"documentation",finalizeDocumentation ctor,stream)
+ lisplibWrite('"documentation",finalizeDocumentation db,stream)
RSHUT(stream)
RPACKFILE([libName,'DOCLB])
$REPLACE([libName,$spadLibFT],[libName,'DOCLB])
@@ -486,6 +486,22 @@ writeConstructorForm db ==
writeCategory db ==
writeInfo(db,dbCategory db,'constructorCategory,'dbCategory)
+writeSourceFile db ==
+ $buildingSystemAlgebra =>
+ -- source file for system constructor is filled at runtime
+ -- to reflect the runtime location of the system directory.
+ lisplibWrite('"sourceFile",dbSourceFile db,dbLibstream db)
+ writeInfo(db,dbSourceFile db,'sourceFile,'dbSourceFile)
+
+writeInteractiveModemaps db ==
+ -- Note: these are never used when building the system algebra.
+ -- But we need them when building the complete set of databases
+ writeInfo(db,dbModemaps db,'modemaps,'dbModemaps)
+
+writeDocumentation(db,doc) ==
+ -- FIXME: Do we want to store documentation in object files?
+ lisplibWrite('"documentation",doc,dbLibstream db)
+
writeSuperDomain db ==
writeInfo(db,dbSuperDomain db,'superDomain,'dbSuperDomain)
@@ -536,8 +552,8 @@ finalizeLisplib(db,libName) ==
-- to the right-hand sides (the definition) for category constructors
if dbConstructorKind db = 'category then
writeCategory db
- lisplibWrite('"sourceFile",dbSourceFile db,dbLibstream db)
- lisplibWrite('"modemaps",dbModemaps db,dbLibstream db)
+ writeSourceFile db
+ writeInteractiveModemaps db
opsAndAtts :=
dbConstructorKind db = 'category => getCategoryOpsAndAtts db
getFunctorOpsAndAtts db
@@ -553,8 +569,7 @@ finalizeLisplib(db,libName) ==
writePrincipals db
writeAncestors db
if not $bootStrapMode then
- lisplibWrite('"documentation",
- finalizeDocumentation dbConstructor db,dbLibstream db)
+ writeDocumentation(db,finalizeDocumentation db)
if $profileCompiler then profileWrite db
leaveIfErrors(libName,dbConstructorKind db)
true