aboutsummaryrefslogtreecommitdiff
path: root/src/interp/database.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/database.boot')
-rw-r--r--src/interp/database.boot19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/interp/database.boot b/src/interp/database.boot
index 01034700..aa460332 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -808,12 +808,18 @@ makeInitialDB [form,kind,abbrev,srcfile] ==
dbSourceFile(db) := srcfile
setAutoLoadProperty form.op
+makeDefaultPackageForm db ==
+ [makeDefaultPackageName symbolName dbConstructor db,
+ :makeDefaultPackageParameters db]
+
printInitdbInfo(path,dbfile) == main(path,dbfile) where
main(path,dbfile) ==
for x in parseSpadFile path repeat
- x is ['DEF,lhs,:.] => fn(lhs,path,dbfile)
- x is ["where",['DEF,lhs,:.],:.] => fn(lhs,path,dbfile)
- fn(lhs,path,dbfile) ==
+ x is ['DEF,lhs,.,rhs] =>
+ fn(lhs,rhs,fileNameString path,dbfile)
+ x is ["where",['DEF,lhs,.,rhs],:.] =>
+ fn(lhs,rhs,fileNameString path,dbfile)
+ fn(lhs,rhs,path,dbfile) ==
if lhs isnt [.,:.] then lhs := [lhs]
db := constructorDB lhs.op
db = nil => nil
@@ -822,6 +828,13 @@ printInitdbInfo(path,dbfile) == main(path,dbfile) where
data := [[lhs.op,:args],dbConstructorKind db,dbAbbreviation db,path]
prettyPrint(['makeInitialDB,quote data],dbfile)
writeNewline dbfile
+ -- If this is a category with defaults, write out the data for
+ -- associated package.
+ dbConstructorKind db isnt 'category or rhs isnt ['add,:.] => nil
+ data := [makeDefaultPackageForm db,'package,
+ makeDefaultPackageAbbreviation db,path]
+ prettyPrint(['makeInitialDB,quote data],dbfile)
+ writeNewline dbfile
printAllInitdbInfo(srcdir,dbfile) ==
paths := DIRECTORY strconc(ensureTrailingSlash srcdir,'"*.spad")