diff options
author | Eduardo Julian | 2020-04-18 04:10:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-04-18 04:10:45 -0400 |
commit | 4955cfe6f248a039e95b404f26abfae04204740f (patch) | |
tree | c86f33b80a6fe944e4aff78641f91bb66103bd91 /new-luxc/source/luxc/lang/translation/jvm.lux | |
parent | ae72864af3e95e46a042277873d38c3006361c79 (diff) |
Generating module IDs in a similar way to artifact IDs.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm.lux | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm.lux b/new-luxc/source/luxc/lang/translation/jvm.lux index 390b1497d..569da0bd9 100644 --- a/new-luxc/source/luxc/lang/translation/jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm.lux @@ -25,6 +25,9 @@ ["." descriptor]]]] [tool [compiler + [language + [lux + ["." generation]]] [meta [archive [descriptor (#+ Module)] @@ -98,14 +101,9 @@ ## It should be cleaned up ASAP. (def: prefix "lux.") -(def: #export class-name' - (-> Text Text) - (|>> (text.replace-all .module-separator ..class-path-separator) - (format ..prefix))) - -(def: #export (class-name module id) - (-> Module artifact.ID Text) - (format (..class-name' module) ..class-path-separator (%.nat id))) +(def: #export (class-name [module-id artifact-id]) + (-> generation.Context Text) + (format ..prefix (%.nat module-id) ..class-path-separator (%.nat artifact-id))) (def: (evaluate! library loader eval-class valueI) (-> Library ClassLoader Text Inst (Try [Any Definition])) @@ -142,9 +140,9 @@ (loader.store class-name class-bytecode library))] (loader.load class-name loader)))) -(def: (define! library loader module id valueI) - (-> Library ClassLoader Module artifact.ID Inst (Try [Text Any Definition])) - (let [class-name (..class-name module id)] +(def: (define! library loader context valueI) + (-> Library ClassLoader generation.Context Inst (Try [Text Any Definition])) + (let [class-name (..class-name context)] (do try.monad [[value definition] (evaluate! library loader class-name valueI)] (wrap [class-name value definition])))) |