diff options
-rw-r--r-- | new-luxc/source/luxc/lang/directive/jvm.lux | 19 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/host/jvm.lux | 4 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/case.lux | 6 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/expression.lux | 8 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/extension/common.lux | 17 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/extension/host.lux | 31 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/function.lux | 10 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/loop.lux | 8 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/reference.lux | 6 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/runtime.lux | 8 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/structure.lux | 6 | ||||
-rw-r--r-- | new-luxc/source/program.lux | 38 | ||||
-rw-r--r-- | stdlib/source/lux/control/parser/analysis.lux | 4 | ||||
-rw-r--r-- | stdlib/source/lux/control/parser/synthesis.lux | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/arity.lux | 1 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/default/init.lux | 36 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/default/platform.lux | 21 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/analysis.lux (renamed from stdlib/source/lux/tool/compiler/analysis.lux) | 10 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/analysis/evaluation.lux (renamed from stdlib/source/lux/tool/compiler/analysis/evaluation.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/analysis/macro.lux (renamed from stdlib/source/lux/tool/compiler/analysis/macro.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/directive.lux (renamed from stdlib/source/lux/tool/compiler/directive.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/generation.lux (renamed from stdlib/source/lux/tool/compiler/generation.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/case.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/function.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/inference.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/inference.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/module.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/module.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/primitive.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/reference.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/scope.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/scope.lux) | 69 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/structure.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/analysis/type.lux (renamed from stdlib/source/lux/tool/compiler/phase/analysis/type.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/directive.lux (renamed from stdlib/source/lux/tool/compiler/phase/directive.lux) | 18 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension.lux) | 3 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/analysis.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/analysis/js.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux) | 242 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/analysis/lux.lux) | 34 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/bundle.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/bundle.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/directive/jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux) | 74 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/generation/jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/common.lux) | 22 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/host.lux) | 76 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/extension/synthesis.lux (renamed from stdlib/source/lux/tool/compiler/phase/extension/synthesis.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/common-lisp/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/extension.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/host.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/case.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/debug.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/debug.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function.lux) | 7 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/abstract.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/abstract.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant/arity.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/foreign.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial/count.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial/count.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/implementation.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux) | 3 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/host.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/loop.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/packager.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/packager.lux) | 7 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/program.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/reference.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux) | 10 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux) | 15 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/type.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/type.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/primitive.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/reference.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux (renamed from stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/synthesis.lux (renamed from stdlib/source/lux/tool/compiler/phase/synthesis.lux) | 28 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/case.lux (renamed from stdlib/source/lux/tool/compiler/phase/synthesis/case.lux) | 58 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/function.lux (renamed from stdlib/source/lux/tool/compiler/phase/synthesis/function.lux) | 77 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/loop.lux (renamed from stdlib/source/lux/tool/compiler/phase/synthesis/loop.lux) | 41 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/language/lux/synthesis.lux (renamed from stdlib/source/lux/tool/compiler/synthesis.lux) | 10 | ||||
-rw-r--r-- | stdlib/source/program/compositor.lux | 15 |
152 files changed, 667 insertions, 567 deletions
diff --git a/new-luxc/source/luxc/lang/directive/jvm.lux b/new-luxc/source/luxc/lang/directive/jvm.lux index bb6c3b1c7..6d446e91d 100644 --- a/new-luxc/source/luxc/lang/directive/jvm.lux +++ b/new-luxc/source/luxc/lang/directive/jvm.lux @@ -21,14 +21,17 @@ ["." row (#+ Row) ("#@." functor fold)]]] [tool [compiler - [synthesis (#+ Synthesis)] - ["." generation] - ["." directive] - ["." phase - ["." extension (#+ Extender) - ["." bundle] - [directive - ["./" lux]]]]]]] + ["." phase] + [language + [lux + [synthesis (#+ Synthesis)] + ["." generation] + ["." directive] + [phase + ["." extension (#+ Extender) + ["." bundle] + [directive + ["./" lux]]]]]]]]] [/// [host ["." jvm (#+ Inst) diff --git a/new-luxc/source/luxc/lang/host/jvm.lux b/new-luxc/source/luxc/lang/host/jvm.lux index e02632d32..5bcc3eef0 100644 --- a/new-luxc/source/luxc/lang/host/jvm.lux +++ b/new-luxc/source/luxc/lang/host/jvm.lux @@ -20,7 +20,9 @@ [tool [compiler [reference (#+ Register)] - ["." generation]]]]) + [language + [lux + ["." generation]]]]]]) (import: org/objectweb/asm/MethodVisitor) diff --git a/new-luxc/source/luxc/lang/translation/jvm/case.lux b/new-luxc/source/luxc/lang/translation/jvm/case.lux index 7ea571450..048acbdab 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/case.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/case.lux @@ -16,8 +16,10 @@ ["." signature (#+ Signature)]]]] [tool [compiler - ["." synthesis (#+ Path Synthesis)] - ["." phase ("operation@." monad)]]]] + ["." phase ("operation@." monad)] + [language + [lux + ["." synthesis (#+ Path Synthesis)]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/expression.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.lux index c6b77e549..ad2da41b6 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/expression.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/expression.lux @@ -2,9 +2,11 @@ [lux #* [tool [compiler - ["." synthesis] - [phase - ["." extension]]]]] + [language + [lux + ["." synthesis] + [phase + ["." extension]]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux b/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux index b2f24de63..cc703f17d 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux @@ -18,13 +18,16 @@ ["." type]]] [tool [compiler - ["." synthesis (#+ Synthesis %synthesis)] - ["." phase - [generation - [extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)]] - ["." extension - ["." bundle]]]]] + ["." phase] + [language + [lux + ["." synthesis (#+ Synthesis %synthesis)] + [phase + [generation + [extension (#+ Nullary Unary Binary Trinary Variadic + nullary unary binary trinary variadic)]] + ["." extension + ["." bundle]]]]]]] [host (#+ import:)]] [luxc [lang diff --git a/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux b/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux index bee116b1a..b5577cfcd 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux @@ -1,5 +1,6 @@ (.module: [lux (#- Type primitive int char type) + [host (#+ import:)] [abstract ["." monad (#+ do)]] [control @@ -28,21 +29,23 @@ ["." parser]]]] [tool [compiler - [analysis (#+ Environment)] ["." reference (#+ Variable)] - ["." synthesis (#+ Synthesis Path %synthesis)] - ["." generation] - ["." phase ("#@." monad) - [generation - [extension (#+ Nullary Unary Binary - nullary unary binary)]] - [analysis - [".A" reference]] - ["." extension - ["." bundle] - [analysis - ["/" jvm]]]]]] - [host (#+ import:)]] + ["." phase ("#@." monad)] + [language + [lux + [analysis (#+ Environment)] + ["." synthesis (#+ Synthesis Path %synthesis)] + ["." generation] + [phase + [generation + [extension (#+ Nullary Unary Binary + nullary unary binary)]] + [analysis + [".A" reference]] + ["." extension + ["." bundle] + [analysis + ["/" jvm]]]]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.lux b/new-luxc/source/luxc/lang/translation/jvm/function.lux index 4d60c5fb0..ec5d9c61f 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.lux @@ -19,10 +19,12 @@ [compiler [arity (#+ Arity)] [reference (#+ Register)] - [analysis (#+ Environment)] - [synthesis (#+ Synthesis Abstraction Apply)] - ["." generation] - ["." phase]]]] + ["." phase] + [language + [lux + [analysis (#+ Environment)] + [synthesis (#+ Synthesis Abstraction Apply)] + ["." generation]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/loop.lux b/new-luxc/source/luxc/lang/translation/jvm/loop.lux index 6f336d7c1..a2c25e883 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/loop.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/loop.lux @@ -12,9 +12,11 @@ [tool [compiler [reference (#+ Register)] - ["." synthesis (#+ Synthesis)] - ["." generation] - ["." phase]]]] + ["." phase] + [language + [lux + ["." synthesis (#+ Synthesis)] + ["." generation]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/reference.lux b/new-luxc/source/luxc/lang/translation/jvm/reference.lux index fd4d12456..ba5cb33de 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/reference.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/reference.lux @@ -12,8 +12,10 @@ [compiler ["." name] ["." reference (#+ Register Variable)] - ["." generation] - ["." phase ("operation@." monad)]]]] + ["." phase ("operation@." monad)] + [language + [lux + ["." generation]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux index 56031fc5a..72763d01f 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux @@ -14,9 +14,11 @@ [tool [compiler [arity (#+ Arity)] - ["." synthesis] - ["." generation] - ["." phase]]]] + ["." phase] + [language + [lux + ["." synthesis] + ["." generation]]]]]] [luxc [lang [host diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.lux index 10c9bacb9..9ce90085c 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/structure.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/structure.lux @@ -19,8 +19,10 @@ ["." signature (#+ Signature)]]]] [tool [compiler - [synthesis (#+ Synthesis)] - ["." phase]]]] + ["." phase] + [language + [lux + [synthesis (#+ Synthesis)]]]]]] [luxc [lang [host diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux index fc34eecdc..fccc63d1a 100644 --- a/new-luxc/source/program.lux +++ b/new-luxc/source/program.lux @@ -24,25 +24,27 @@ [bytecode (#+ Bytecode)]]] [tool [compiler - [analysis - ["." macro (#+ Expander)]] - [phase - [extension (#+ Phase Bundle Operation Handler Extender) - ["." analysis #_ - ["#" jvm]] - ["." generation #_ - ["#" jvm]] - ## ["." directive #_ - ## ["#" jvm]] - ] - [generation - ["." jvm #_ - ## ["." runtime (#+ Anchor Definition)] - ["." packager] - ## ["#/." host] - ]]] [default - ["." platform (#+ Platform)]]]]] + ["." platform (#+ Platform)]] + [language + [lux + [analysis + ["." macro (#+ Expander)]] + [phase + [extension (#+ Phase Bundle Operation Handler Extender) + ["." analysis #_ + ["#" jvm]] + ["." generation #_ + ["#" jvm]] + ## ["." directive #_ + ## ["#" jvm]] + ] + [generation + ["." jvm #_ + ## ["." runtime (#+ Anchor Definition)] + ["." packager] + ## ["#/." host] + ]]]]]]]] [program ["/" compositor ["/." cli]]] diff --git a/stdlib/source/lux/control/parser/analysis.lux b/stdlib/source/lux/control/parser/analysis.lux index 0cef19fd9..fe8b4c4f0 100644 --- a/stdlib/source/lux/control/parser/analysis.lux +++ b/stdlib/source/lux/control/parser/analysis.lux @@ -22,7 +22,9 @@ [compiler [reference (#+)] [arity (#+ Arity)] - ["/" analysis (#+ Variant Tuple Environment Analysis)]]]] + [language + [lux + ["/" analysis (#+ Variant Tuple Environment Analysis)]]]]]] ["." //]) (def: (remaining-inputs asts) diff --git a/stdlib/source/lux/control/parser/synthesis.lux b/stdlib/source/lux/control/parser/synthesis.lux index 0c52b878c..5e3b1dadb 100644 --- a/stdlib/source/lux/control/parser/synthesis.lux +++ b/stdlib/source/lux/control/parser/synthesis.lux @@ -20,8 +20,10 @@ [compiler [reference (#+)] [arity (#+ Arity)] - [analysis (#+ Variant Tuple Environment)] - ["/" synthesis (#+ Synthesis Abstraction)]]]] + [language + [lux + [analysis (#+ Variant Tuple Environment)] + ["/" synthesis (#+ Synthesis Abstraction)]]]]]] ["." //]) (def: (remaining-inputs asts) diff --git a/stdlib/source/lux/tool/compiler/arity.lux b/stdlib/source/lux/tool/compiler/arity.lux index 54b50cab2..84c2b8e9e 100644 --- a/stdlib/source/lux/tool/compiler/arity.lux +++ b/stdlib/source/lux/tool/compiler/arity.lux @@ -9,6 +9,7 @@ (template [<comparison> <name>] [(def: #export <name> (-> Arity Bit) (<comparison> 1))] + [n.< nullary?] [n.= unary?] [n.> multiary?] ) diff --git a/stdlib/source/lux/tool/compiler/default/init.lux b/stdlib/source/lux/tool/compiler/default/init.lux index 370894d26..14d04a226 100644 --- a/stdlib/source/lux/tool/compiler/default/init.lux +++ b/stdlib/source/lux/tool/compiler/default/init.lux @@ -19,23 +19,25 @@ ["/#" // (#+ Instancer) [language [lux - ["." syntax (#+ Aliases)]]] - ["#." analysis - [macro (#+ Expander)] - ["#/." evaluation]] - ["#." synthesis] - ["#." directive (#+ Requirements)] - ["#." generation] - ["#." phase - [".P" analysis - ["." module]] - [".P" synthesis] - [".P" directive] - ["." extension (#+ Extender) - [".E" analysis] - [".E" synthesis] - [directive - [".D" lux]]]] + ["." syntax (#+ Aliases)] + ["#." analysis + [macro (#+ Expander)] + ["#/." evaluation]] + ["#." synthesis] + ["#." directive (#+ Requirements)] + ["#." generation] + [phase + [".P" analysis + ["." module]] + [".P" synthesis] + [".P" directive] + ["." extension (#+ Extender) + [".E" analysis] + [".E" synthesis] + [directive + [".D" lux]]]] + [/// + ["#." phase]]]] [meta [archive ["." signature] diff --git a/stdlib/source/lux/tool/compiler/default/platform.lux b/stdlib/source/lux/tool/compiler/default/platform.lux index c6df2955e..36fc26363 100644 --- a/stdlib/source/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/lux/tool/compiler/default/platform.lux @@ -19,18 +19,19 @@ ["." // #_ ["#." init] ["/#" // + ["#." phase] [language [lux - ["." syntax]]] - ["#." analysis - [macro (#+ Expander)]] - ["#." generation (#+ Buffer)] - ["#." directive] - ["#." phase - ## TODO: Get rid of this import ASAP - ["." extension (#+ Extender)] - [analysis - ["." module]]] + ["." syntax] + ["#." analysis + [macro (#+ Expander)]] + ["#." generation (#+ Buffer)] + ["#." directive] + [phase + ## TODO: Get rid of this import ASAP + ["." extension (#+ Extender)] + [analysis + ["." module]]]]] [meta ["." archive (#+ Archive) [descriptor (#+ Module)]] diff --git a/stdlib/source/lux/tool/compiler/analysis.lux b/stdlib/source/lux/tool/compiler/language/lux/analysis.lux index 5d9d899ab..6c081620c 100644 --- a/stdlib/source/lux/tool/compiler/analysis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/analysis.lux @@ -16,10 +16,12 @@ [collection ["." list ("#@." functor fold)]]]] [// - [arity (#+ Arity)] - ["." reference (#+ Register Variable Reference)] - ["." phase - ["." extension (#+ Extension)]]]) + [phase + ["." extension (#+ Extension)]] + [/// + [arity (#+ Arity)] + ["." reference (#+ Register Variable Reference)] + ["." phase]]]) (type: #export #rec Primitive #Unit diff --git a/stdlib/source/lux/tool/compiler/analysis/evaluation.lux b/stdlib/source/lux/tool/compiler/language/lux/analysis/evaluation.lux index 08a57bf20..710bb3eb0 100644 --- a/stdlib/source/lux/tool/compiler/analysis/evaluation.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/analysis/evaluation.lux @@ -10,13 +10,15 @@ [// (#+ Operation) [macro (#+ Expander)] [// - ["." phase + [phase + [".P" synthesis] [".P" analysis ["." type]] - [".P" synthesis] [// ["." synthesis] - ["." generation]]]]]) + ["." generation] + [/// + ["." phase]]]]]]) (type: #export Eval (-> Nat Type Code (Operation Any))) diff --git a/stdlib/source/lux/tool/compiler/analysis/macro.lux b/stdlib/source/lux/tool/compiler/language/lux/analysis/macro.lux index 9e191e514..89731a81b 100644 --- a/stdlib/source/lux/tool/compiler/analysis/macro.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/analysis/macro.lux @@ -12,7 +12,7 @@ [array (#+ Array)] ["." list ("#@." functor)]]] ["." macro]] - [/// + [///// ["." phase]]) (exception: #export (expansion-failed {macro Name} {inputs (List Code)} {error Text}) diff --git a/stdlib/source/lux/tool/compiler/directive.lux b/stdlib/source/lux/tool/compiler/language/lux/directive.lux index 31edabddb..2c1dd3be6 100644 --- a/stdlib/source/lux/tool/compiler/directive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/directive.lux @@ -2,16 +2,18 @@ [lux (#- Module) [data [collection - ["." list ("#;." monoid)]]]] + ["." list ("#@." monoid)]]]] [// - [meta - [archive - [descriptor (#+ Module)]]] ["." analysis] ["." synthesis] ["." generation] - ["." phase - ["." extension]]]) + [phase + ["." extension]] + [/// + ["." phase] + [meta + [archive + [descriptor (#+ Module)]]]]]) (type: #export (Component state phase) {#state state @@ -40,8 +42,8 @@ (def: #export (merge-requirements left right) (-> Requirements Requirements Requirements) - {#imports (list;compose (get@ #imports left) (get@ #imports right)) - #referrals (list;compose (get@ #referrals left) (get@ #referrals right))}) + {#imports (list@compose (get@ #imports left) (get@ #imports right)) + #referrals (list@compose (get@ #referrals left) (get@ #referrals right))}) (template [<special> <general>] [(type: #export (<special> anchor expression directive) diff --git a/stdlib/source/lux/tool/compiler/generation.lux b/stdlib/source/lux/tool/compiler/language/lux/generation.lux index e29036dd9..334be5331 100644 --- a/stdlib/source/lux/tool/compiler/generation.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/generation.lux @@ -15,12 +15,14 @@ ["." dictionary (#+ Dictionary)] ["." list ("#@." functor)]]]] [// - ["." phase - ["." extension]] [synthesis (#+ Synthesis)] - [meta - [archive - [descriptor (#+ Module)]]]]) + [phase + ["." extension]] + [/// + ["." phase] + [meta + [archive + [descriptor (#+ Module)]]]]]) (type: #export Registry (Dictionary Name Text)) diff --git a/stdlib/source/lux/tool/compiler/phase/analysis.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis.lux index 5a03a40c3..cd8a723b0 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis.lux @@ -15,12 +15,14 @@ ["#." reference] ["#." case] ["#." function] - ["#/" // + ["/#" // #_ ["#." extension] - ["#/" // #_ - ["#." reference] + ["/#" // #_ ["/" analysis (#+ Analysis Operation Phase) - ["#." macro (#+ Expander)]]]]]) + ["#." macro (#+ Expander)]] + [/// + ["//" phase] + ["." reference]]]]]) (exception: #export (unrecognized-syntax {code Code}) (ex.report ["Code" (%.code code)])) @@ -102,7 +104,7 @@ [[functionT functionA] (/type.with-inference (compile functionC))] (case functionA - (#/.Reference (#///reference.Constant def-name)) + (#/.Reference (#reference.Constant def-name)) (do @ [?macro (//extension.lift (macro.find-macro def-name))] (case ?macro diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case.lux index c69abb4df..a74613491 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case.lux @@ -18,16 +18,18 @@ ["." check]] ["." macro ["." code]]] - ["." // #_ - ["#." scope] - ["#." type] - ["#." structure] - ["#/" // - ["#." extension] - [// - ["/" analysis (#+ Pattern Analysis Operation Phase)]]]] ["." / #_ - ["#." coverage (#+ Coverage)]]) + ["#." coverage (#+ Coverage)] + ["/#" // #_ + ["#." scope] + ["#." type] + ["#." structure] + ["/#" // #_ + ["#." extension] + [// + ["/" analysis (#+ Pattern Analysis Operation Phase)] + [/// + ["#" phase]]]]]]) (exception: #export (cannot-match-with-pattern {type Type} {pattern Code}) (ex.report ["Type" (%.type type)] diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux index f81fa19fd..ec76fb1f5 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/case/coverage.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux @@ -16,9 +16,11 @@ [collection ["." list ("#@." functor fold)] ["." dictionary (#+ Dictionary)]]]] - ["." //// ("#@." monad) + ["." //// #_ [// - ["/" analysis (#+ Pattern Variant Operation)]]]) + ["/" analysis (#+ Pattern Variant Operation)] + [/// + ["#" phase ("#@." monad)]]]]) (exception: #export (invalid-tuple-pattern) "Tuple size must be >= 2") diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/function.lux index 5e5e26b85..7e367ee5c 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -17,10 +17,12 @@ ["#." scope] ["#." type] ["#." inference] - ["#/" // + ["/#" // #_ ["#." extension] [// - ["/" analysis (#+ Analysis Operation Phase)]]]]) + ["/" analysis (#+ Analysis Operation Phase)] + [/// + ["#" phase]]]]]) (exception: #export (cannot-analyse {expected Type} {function Text} {argument Text} {body Code}) (ex.report ["Type" (%.type expected)] diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/inference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/inference.lux index f3cc27357..4510cf1dd 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/inference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/inference.lux @@ -17,10 +17,12 @@ ["." macro]] ["." // #_ ["#." type] - ["#/" // ("#@." monad) + ["/#" // #_ ["#." extension] [// - ["/" analysis (#+ Tag Analysis Operation Phase)]]]]) + ["/" analysis (#+ Tag Analysis Operation Phase)] + [/// + ["#" phase ("#@." monad)]]]]]) (exception: #export (variant-tag-out-of-bounds {size Nat} {tag Tag} {type Type}) (ex.report ["Tag" (%.nat tag)] diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/module.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/module.lux index a6e1bedbd..1764dfdd6 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/module.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/module.lux @@ -14,10 +14,12 @@ [dictionary ["." plist]]]] ["." macro]] - ["." /// + ["." /// #_ ["#." extension] [// - ["/" analysis (#+ Operation)]]]) + ["/" analysis (#+ Operation)] + [/// + ["#" phase]]]]) (type: #export Tag Text) diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/primitive.lux index 392ae4d8e..dfdb7e314 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/primitive.lux @@ -4,9 +4,11 @@ monad]] ["." // #_ ["#." type] - ["#/" // + ["/#" // #_ [// - ["/" analysis (#+ Analysis Operation)]]]]) + ["/" analysis (#+ Analysis Operation)] + [/// + ["#" phase]]]]]) (template [<name> <type> <tag>] [(def: #export (<name> value) diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/reference.lux index 6a5c4f889..950c6a360 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -11,11 +11,13 @@ ["." // #_ ["#." scope] ["#." type] - ["#/" // + ["/#" // #_ ["#." extension] - ["#/" // #_ - ["#." reference] - ["/" analysis (#+ Analysis Operation)]]]]) + [// + ["/" analysis (#+ Analysis Operation)] + [/// + ["#." reference] + ["#" phase]]]]]) (exception: #export (foreign-module-has-not-been-imported {current Text} {foreign Text}) (exception.report @@ -28,7 +30,7 @@ (def: (definition def-name) (-> Name (Operation Analysis)) - (with-expansions [<return> (wrap (|> def-name ////reference.constant #/.Reference))] + (with-expansions [<return> (wrap (|> def-name ///reference.constant #/.Reference))] (do ///.monad [constant (///extension.lift (macro.find-def def-name))] (case constant @@ -58,7 +60,7 @@ (#.Some [actualT ref]) (do @ [_ (//type.infer actualT)] - (wrap (#.Some (|> ref ////reference.variable #/.Reference)))) + (wrap (#.Some (|> ref ///reference.variable #/.Reference)))) #.None (wrap #.None)))) diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/scope.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/scope.lux index e5d145a54..d68d3fed7 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/scope.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/scope.lux @@ -3,21 +3,23 @@ [abstract monad] [control - ["e" try] + ["." try] ["ex" exception (#+ exception:)]] [data - ["." text ("#;." equivalence)] - ["." maybe ("#;." monad)] + ["." text ("#@." equivalence)] + ["." maybe ("#@." monad)] ["." product] [collection - ["." list ("#;." functor fold monoid)] + ["." list ("#@." functor fold monoid)] [dictionary ["." plist]]]]] - ["." /// + ["." /// #_ ["#." extension] - ["#/" // #_ - ["#." reference (#+ Register Variable)] - ["/" analysis (#+ Operation Phase)]]]) + [// + ["/" analysis (#+ Operation Phase)] + [/// + ["." reference (#+ Register Variable)] + ["#" phase]]]]) (type: Local (Bindings Text [Type Register])) (type: Foreign (Bindings Text [Type Variable])) @@ -33,8 +35,8 @@ (|> scope (get@ [#.locals #.mappings]) (plist.get name) - (maybe;map (function (_ [type value]) - [type (#////reference.Local value)])))) + (maybe@map (function (_ [type value]) + [type (#reference.Local value)])))) (def: (captured? name scope) (-> Text Scope Bit) @@ -48,8 +50,8 @@ mappings (get@ [#.captured #.mappings] scope)] (case mappings (#.Cons [_name [_source-type _source-ref]] mappings') - (if (text;= name _name) - (#.Some [_source-type (#////reference.Foreign idx)]) + (if (text@= name _name) + (#.Some [_source-type (#reference.Foreign idx)]) (recur (inc idx) mappings')) #.Nil @@ -83,9 +85,9 @@ (#.Cons top-outer _) (let [[ref-type init-ref] (maybe.default (undefined) (..reference name top-outer)) - [ref inner'] (list;fold (: (-> Scope [Variable (List Scope)] [Variable (List Scope)]) + [ref inner'] (list@fold (: (-> Scope [Variable (List Scope)] [Variable (List Scope)]) (function (_ scope ref+inner) - [(#////reference.Foreign (get@ [#.captured #.counter] scope)) + [(#reference.Foreign (get@ [#.captured #.counter] scope)) (#.Cons (update@ #.captured (: (-> Foreign Foreign) (|>> (update@ #.counter inc) @@ -94,7 +96,7 @@ (product.right ref+inner))])) [init-ref #.Nil] (list.reverse inner)) - scopes (list;compose inner' outer)] + scopes (list@compose inner' outer)] (#.Right [(set@ #.scopes scopes state) (#.Some [ref-type ref])])) ))))) @@ -119,19 +121,19 @@ head)] (case (///.run' [bundle (set@ #.scopes (#.Cons new-head tail) state)] action) - (#e.Success [[bundle' state'] output]) + (#try.Success [[bundle' state'] output]) (case (get@ #.scopes state') (#.Cons head' tail') (let [scopes' (#.Cons (set@ #.locals (get@ #.locals head) head') tail')] - (#e.Success [[bundle' (set@ #.scopes scopes' state')] - output])) + (#try.Success [[bundle' (set@ #.scopes scopes' state')] + output])) _ (ex.throw invalid-scope-alteration [])) - (#e.Failure error) - (#e.Failure error))) + (#try.Failure error) + (#try.Failure error))) _ (ex.throw cannot-create-local-binding-without-a-scope [])) @@ -166,18 +168,17 @@ (case (action [bundle (update@ #.scopes (|>> (#.Cons (scope parent-name name))) state)]) - (#e.Success [[bundle' state'] output]) - (#e.Success [[bundle' (update@ #.scopes - (|>> list.tail (maybe.default (list))) - state')] - output]) - - (#e.Failure error) - (#e.Failure error))) + (#try.Success [[bundle' state'] output]) + (#try.Success [[bundle' (update@ #.scopes + (|>> list.tail (maybe.default (list))) + state')] + output]) + + (#try.Failure error) + (#try.Failure error))) )) -(exception: #export (cannot-get-next-reference-when-there-is-no-scope) - "") +(exception: #export cannot-get-next-reference-when-there-is-no-scope) (def: #export next-local (Operation Register) @@ -185,7 +186,7 @@ (function (_ state) (case (get@ #.scopes state) (#.Cons top _) - (#e.Success [state (get@ [#.locals #.counter] top)]) + (#try.Success [state (get@ [#.locals #.counter] top)]) #.Nil (ex.throw cannot-get-next-reference-when-there-is-no-scope []))))) @@ -194,13 +195,13 @@ (-> Ref Variable) (case ref (#.Local register) - (#////reference.Local register) + (#reference.Local register) (#.Captured register) - (#////reference.Foreign register))) + (#reference.Foreign register))) (def: #export (environment scope) (-> Scope (List Variable)) (|> scope (get@ [#.captured #.mappings]) - (list;map (function (_ [_ [_ ref]]) (ref-to-variable ref))))) + (list@map (function (_ [_ [_ ref]]) (ref-to-variable ref))))) diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/structure.lux index 49447e847..ee4ebb40d 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/structure.lux @@ -24,10 +24,12 @@ ["#." type] ["#." primitive] ["#." inference] - ["#/" // + ["/#" // #_ ["#." extension] [// - ["/" analysis (#+ Tag Analysis Operation Phase)]]]]) + ["/" analysis (#+ Tag Analysis Operation Phase)] + [/// + ["#" phase]]]]]) (exception: #export (invalid-variant-type {type Type} {tag Tag} {code Code}) (ex.report ["Type" (%.type type)] diff --git a/stdlib/source/lux/tool/compiler/phase/analysis/type.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/type.lux index 20b313381..1de24a1c0 100644 --- a/stdlib/source/lux/tool/compiler/phase/analysis/type.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/analysis/type.lux @@ -8,10 +8,12 @@ [type ["." check (#+ Check)]] ["." macro]] - ["." /// + ["." /// #_ ["#." extension] [// - ["/" analysis (#+ Operation)]]]) + ["/" analysis (#+ Operation)] + [/// + ["#" phase]]]]) (def: #export (with-type expected) (All [a] (-> Type (Operation a) (Operation a))) diff --git a/stdlib/source/lux/tool/compiler/phase/directive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/directive.lux index 0144c877c..a6311eaf8 100644 --- a/stdlib/source/lux/tool/compiler/phase/directive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/directive.lux @@ -10,15 +10,17 @@ [collection ["." list ("#;." fold monoid)]]] ["." macro]] - ["." // + ["." // #_ ["#." extension] - [".P" analysis - ["." type]] - ["#/" // #_ - [reference (#+)] + ["#." analysis + ["#/." type]] + ["/#" // #_ + ["/" directive (#+ Phase)] ["#." analysis ["#/." macro (#+ Expander)]] - ["/" directive (#+ Phase)]]]) + [/// + [reference (#+)] + ["//" phase]]]]) (exception: #export (not-a-directive {code Code}) (exception.report @@ -35,7 +37,7 @@ (with-expansions [<lux_def_module> (as-is [|form-cursor| (#.Form (list& [|text-cursor| (#.Text "lux def module")] annotations))])] (def: #export (phase expander) (-> Expander Phase) - (let [analyze (analysisP.phase expander)] + (let [analyze (//analysis.phase expander)] (function (recur code) (case code (^ [_ (#.Form (list& [_ (#.Text name)] inputs))]) @@ -45,7 +47,7 @@ (do //.monad [expansion (/.lift-analysis (do @ - [macroA (type.with-type Macro + [macroA (//analysis/type.with-type Macro (analyze macro))] (case macroA (^ (///analysis.constant macro-name)) diff --git a/stdlib/source/lux/tool/compiler/phase/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension.lux index 7ba769476..a3e841912 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension.lux @@ -12,7 +12,8 @@ [collection ["." list ("#@." functor)] ["." dictionary (#+ Dictionary)]]]] - ["." //]) + [///// + ["//" phase]]) (type: #export Name Text) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis.lux index 0f38bce97..0f38bce97 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis.lux diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/js.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux index 0b9c4de2f..0b9c4de2f 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/js.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index c4481998e..aaa37ccfc 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -42,18 +42,20 @@ ["#." lux (#+ custom)] ["/#" // ["#." bundle] - ["/#" // ("#@." monad) + ["/#" // #_ [analysis [".A" type] [".A" inference] ["." scope]] ["/#" // #_ - [reference (#+)] ["#." analysis (#+ Analysis Operation Phase Handler Bundle)] ["#." synthesis] - [meta - [archive - [descriptor (#+ Module)]]]]]]]) + [/// + [reference (#+)] + ["." phase ("#@." monad)] + [meta + [archive + [descriptor (#+ Module)]]]]]]]]) (def: reflection (All [category] @@ -273,24 +275,24 @@ (/////analysis.throw ..non-jvm-type luxT)) (^ (#.Primitive (static array.type-name) (list elemT))) - (////@map jvm.array (jvm-type elemT)) + (phase@map jvm.array (jvm-type elemT)) (#.Primitive class parametersT) (case (dictionary.get class ..boxes) (#.Some [_ primitive-type]) (case parametersT #.Nil - (////@wrap primitive-type) + (phase@wrap primitive-type) _ (/////analysis.throw ..primitives-cannot-have-type-parameters class)) #.None - (do ////.monad + (do phase.monad [parametersJT (: (Operation (List (Type Parameter))) (monad.map @ (function (_ parameterT) - (do ////.monad + (do phase.monad [parameterJT (jvm-type parameterT)] (case (jvm-parser.parameter? parameterJT) (#.Some parameterJT) @@ -302,26 +304,26 @@ (wrap (jvm.class class parametersJT)))) (#.Ex _) - (////@wrap (jvm.class ..object-class (list))) + (phase@wrap (jvm.class ..object-class (list))) _ (/////analysis.throw ..non-jvm-type luxT))) (def: (jvm-array-type objectT) (-> .Type (Operation (Type Array))) - (do ////.monad + (do phase.monad [objectJ (jvm-type objectT)] (|> objectJ ..signature (<t>.run jvm-parser.array) - ////.lift))) + phase.lift))) (def: (primitive-array-length-handler primitive-type) (-> (Type Primitive) Handler) (function (_ extension-name analyse args) (case args (^ (list arrayC)) - (do ////.monad + (do phase.monad [_ (typeA.infer ..int) arrayA (typeA.with-type (#.Primitive (|> (jvm.array primitive-type) ..reflection) @@ -337,7 +339,7 @@ (function (_ extension-name analyse args) (case args (^ (list arrayC)) - (do ////.monad + (do phase.monad [_ (typeA.infer ..int) [var-id varT] (typeA.with-env check.var) arrayA (typeA.with-type (.type (array.Array varT)) @@ -355,7 +357,7 @@ (function (_ extension-name analyse args) (case args (^ (list lengthC)) - (do ////.monad + (do phase.monad [lengthA (typeA.with-type ..int (analyse lengthC)) _ (typeA.infer (#.Primitive (|> (jvm.array primitive-type) ..reflection) @@ -370,7 +372,7 @@ (function (_ extension-name analyse args) (case args (^ (list lengthC)) - (do ////.monad + (do phase.monad [lengthA (typeA.with-type ..int (analyse lengthC)) expectedT (///.lift macro.expected-type) @@ -410,14 +412,14 @@ (/////analysis.throw ..non-parameter objectT) ## else - (////@wrap (jvm.class name (list))))) + (phase@wrap (jvm.class name (list))))) (#.Named name anonymous) (check-parameter anonymous) (^template [<tag>] (<tag> id) - (////@wrap (jvm.class ..object-class (list)))) + (phase@wrap (jvm.class ..object-class (list)))) ([#.Var] [#.Ex]) @@ -444,7 +446,7 @@ (#.Primitive name #.Nil) (`` (cond (~~ (template [<type>] [(text@= (..reflection <type>) name) - (////@wrap <type>)] + (phase@wrap <type>)] [jvm.boolean] [jvm.byte] @@ -457,7 +459,7 @@ (~~ (template [<type>] [(text@= (..reflection (jvm.array <type>)) name) - (////@wrap (jvm.array <type>))] + (phase@wrap (jvm.array <type>))] [jvm.boolean] [jvm.byte] @@ -470,22 +472,22 @@ (text.starts-with? descriptor.array-prefix name) (let [[_ unprefixed] (maybe.assume (text.split-with descriptor.array-prefix name))] - (:: ////.monad map jvm.array + (:: phase.monad map jvm.array (check-jvm (#.Primitive unprefixed (list))))) ## else - (////@wrap (jvm.class name (list))))) + (phase@wrap (jvm.class name (list))))) (^ (#.Primitive (static array.type-name) (list elementT))) (|> elementT check-jvm - (////@map jvm.array)) + (phase@map jvm.array)) (#.Primitive name parameters) - (do ////.monad + (do phase.monad [parameters (monad.map @ check-parameter parameters)] - (////@wrap (jvm.class name parameters))) + (phase@wrap (jvm.class name parameters))) (#.Named name anonymous) (check-jvm anonymous) @@ -509,16 +511,16 @@ (def: (check-object objectT) (-> .Type (Operation External)) - (do ////.monad + (do phase.monad [name (:: @ map ..reflection (check-jvm objectT))] (if (dictionary.contains? name ..boxes) (/////analysis.throw ..primitives-are-not-objects [name]) - (////@wrap name)))) + (phase@wrap name)))) (def: (check-return type) (-> .Type (Operation (Type Return))) (if (is? .Any type) - (////@wrap jvm.void) + (phase@wrap jvm.void) (check-jvm type))) (def: (read-primitive-array-handler lux-type jvm-type) @@ -526,7 +528,7 @@ (function (_ extension-name analyse args) (case args (^ (list idxC arrayC)) - (do ////.monad + (do phase.monad [_ (typeA.infer lux-type) idxA (typeA.with-type ..int (analyse idxC)) @@ -543,7 +545,7 @@ (function (_ extension-name analyse args) (case args (^ (list idxC arrayC)) - (do ////.monad + (do phase.monad [[var-id varT] (typeA.with-env check.var) _ (typeA.infer varT) arrayA (typeA.with-type (.type (array.Array varT)) @@ -567,7 +569,7 @@ (function (_ extension-name analyse args) (case args (^ (list idxC valueC arrayC)) - (do ////.monad + (do phase.monad [_ (typeA.infer array-type) idxA (typeA.with-type ..int (analyse idxC)) @@ -587,7 +589,7 @@ (function (_ extension-name analyse args) (case args (^ (list idxC valueC arrayC)) - (do ////.monad + (do phase.monad [[var-id varT] (typeA.with-env check.var) _ (typeA.infer (.type (array.Array varT))) arrayA (typeA.with-type (.type (array.Array varT)) @@ -662,7 +664,7 @@ (function (_ extension-name analyse args) (case args (^ (list)) - (do ////.monad + (do phase.monad [expectedT (///.lift macro.expected-type) _ (check-object expectedT)] (wrap (#/////analysis.Extension extension-name (list)))) @@ -675,7 +677,7 @@ (function (_ extension-name analyse args) (case args (^ (list objectC)) - (do ////.monad + (do phase.monad [_ (typeA.infer Bit) [objectT objectA] (typeA.with-inference (analyse objectC)) @@ -690,7 +692,7 @@ (function (_ extension-name analyse args) (case args (^ (list monitorC exprC)) - (do ////.monad + (do phase.monad [[monitorT monitorA] (typeA.with-inference (analyse monitorC)) _ (check-object monitorT) @@ -705,12 +707,12 @@ (function (_ extension-name analyse args) (case args (^ (list exceptionC)) - (do ////.monad + (do phase.monad [_ (typeA.infer Nothing) [exceptionT exceptionA] (typeA.with-inference (analyse exceptionC)) exception-class (check-object exceptionT) - ? (////.lift (reflection!.sub? "java.lang.Throwable" exception-class)) + ? (phase.lift (reflection!.sub? "java.lang.Throwable" exception-class)) _ (: (Operation Any) (if ? (wrap []) @@ -727,9 +729,9 @@ (^ (list classC)) (case classC [_ (#.Text class)] - (do ////.monad + (do phase.monad [_ (typeA.infer (#.Primitive "java.lang.Class" (list (#.Primitive class (list))))) - _ (////.lift (reflection!.load class))] + _ (phase.lift (reflection!.load class))] (wrap (#/////analysis.Extension extension-name (list (/////analysis.text class))))) _ @@ -743,12 +745,12 @@ (..custom [($_ <>.and <c>.text <c>.any) (function (_ extension-name analyse [sub-class objectC]) - (do ////.monad + (do phase.monad [_ (typeA.infer Bit) [objectT objectA] (typeA.with-inference (analyse objectC)) object-class (check-object objectT) - ? (////.lift (reflection!.sub? object-class sub-class))] + ? (phase.lift (reflection!.sub? object-class sub-class))] (if ? (wrap (#/////analysis.Extension extension-name (list (/////analysis.text sub-class) objectA))) (/////analysis.throw cannot-possibly-be-an-instance (format sub-class " !<= " object-class)))))])) @@ -805,7 +807,7 @@ check) (#try.Failure error) - (////.fail error)))] + (phase.fail error)))] [reflection-type Value luxT.type] [reflection-return Return luxT.return] @@ -813,15 +815,15 @@ (def: (class-candidate-parents from-name fromT to-name to-class) (-> External .Type External (java/lang/Class java/lang/Object) (Operation (List [[Text .Type] Bit]))) - (do ////.monad - [from-class (////.lift (reflection!.load from-name)) - mapping (////.lift (reflection!.correspond from-class fromT))] + (do phase.monad + [from-class (phase.lift (reflection!.load from-name)) + mapping (phase.lift (reflection!.correspond from-class fromT))] (monad.map @ (function (_ superJT) (do @ - [superJT (////.lift (reflection!.type superJT)) + [superJT (phase.lift (reflection!.type superJT)) #let [super-name (|> superJT ..reflection)] - super-class (////.lift (reflection!.load super-name)) + super-class (phase.lift (reflection!.load super-name)) superT (reflection-type mapping superJT)] (wrap [[super-name superT] (java/lang/Class::isAssignableFrom super-class to-class)]))) (case (java/lang/Class::getGenericSuperclass from-class) @@ -838,11 +840,11 @@ (-> .Type (java/lang/Class java/lang/Object) .Type Code (Operation (List [[Text .Type] Bit]))) (case fromT (^ (#.Primitive _ (list& self-classT super-classT super-interfacesT+))) - (monad.map ////.monad + (monad.map phase.monad (function (_ superT) - (do ////.monad + (do phase.monad [super-name (:: @ map ..reflection (check-jvm superT)) - super-class (////.lift (reflection!.load super-name))] + super-class (phase.lift (reflection!.load super-name))] (wrap [[super-name superT] (java/lang/Class::isAssignableFrom super-class to-class)]))) (list& super-classT super-interfacesT+)) @@ -855,7 +857,7 @@ (function (_ extension-name analyse args) (case args (^ (list fromC)) - (do ////.monad + (do phase.monad [toT (///.lift macro.expected-type) to-name (:: @ map ..reflection (check-jvm toT)) [fromT fromA] (typeA.with-inference @@ -882,17 +884,17 @@ ## else (do @ - [_ (////.assert ..primitives-are-not-objects [from-name] - (not (dictionary.contains? from-name ..boxes))) - _ (////.assert ..primitives-are-not-objects [to-name] - (not (dictionary.contains? to-name ..boxes))) - to-class (////.lift (reflection!.load to-name)) + [_ (phase.assert ..primitives-are-not-objects [from-name] + (not (dictionary.contains? from-name ..boxes))) + _ (phase.assert ..primitives-are-not-objects [to-name] + (not (dictionary.contains? to-name ..boxes))) + to-class (phase.lift (reflection!.load to-name)) _ (if (text@= ..inheritance-relationship-type-name from-name) (wrap []) (do @ - [from-class (////.lift (reflection!.load from-name))] - (////.assert cannot-cast [fromT toT fromC] - (java/lang/Class::isAssignableFrom from-class to-class))))] + [from-class (phase.lift (reflection!.load from-name))] + (phase.assert cannot-cast [fromT toT fromC] + (java/lang/Class::isAssignableFrom from-class to-class))))] (loop [[current-name currentT] [from-name fromT]] (if (text@= to-name current-name) (wrap true) @@ -937,8 +939,8 @@ (..custom [..member (function (_ extension-name analyse [class field]) - (do ////.monad - [[final? fieldJT] (////.lift + (do phase.monad + [[final? fieldJT] (phase.lift (do try.monad [class (reflection!.load class)] (reflection!.static-field field class))) @@ -954,15 +956,15 @@ (..custom [($_ <>.and ..member <c>.any) (function (_ extension-name analyse [[class field] valueC]) - (do ////.monad + (do phase.monad [_ (typeA.infer Any) - [final? fieldJT] (////.lift + [final? fieldJT] (phase.lift (do try.monad [class (reflection!.load class)] (reflection!.static-field field class))) fieldT (reflection-type luxT.fresh fieldJT) - _ (////.assert ..cannot-set-a-final-field [class field] - (not final?)) + _ (phase.assert ..cannot-set-a-final-field [class field] + (not final?)) valueA (typeA.with-type fieldT (analyse valueC))] (wrap (<| (#/////analysis.Extension extension-name) @@ -975,10 +977,10 @@ (..custom [($_ <>.and ..member <c>.any) (function (_ extension-name analyse [[class field] objectC]) - (do ////.monad + (do phase.monad [[objectT objectA] (typeA.with-inference (analyse objectC)) - [mapping fieldJT] (////.lift + [mapping fieldJT] (phase.lift (do try.monad [class (reflection!.load class) [final? fieldJT] (reflection!.virtual-field field class) @@ -996,19 +998,19 @@ (..custom [($_ <>.and ..member <c>.any <c>.any) (function (_ extension-name analyse [[class field] valueC objectC]) - (do ////.monad + (do phase.monad [[objectT objectA] (typeA.with-inference (analyse objectC)) _ (typeA.infer objectT) - [final? mapping fieldJT] (////.lift + [final? mapping fieldJT] (phase.lift (do try.monad [class (reflection!.load class) [final? fieldJT] (reflection!.virtual-field field class) mapping (reflection!.correspond class objectT)] (wrap [final? mapping fieldJT]))) fieldT (reflection-type mapping fieldJT) - _ (////.assert cannot-set-a-final-field [class field] - (not final?)) + _ (phase.assert cannot-set-a-final-field [class field] + (not final?)) valueA (typeA.with-type fieldT (analyse valueC))] (wrap (<| (#/////analysis.Extension extension-name) @@ -1026,11 +1028,11 @@ (def: (check-method aliasing class method-name method-style inputsJT method) (-> Aliasing (java/lang/Class java/lang/Object) Text Method-Style (List (Type Value)) java/lang/reflect/Method (Operation Bit)) - (do ////.monad + (do phase.monad [parameters (|> (java/lang/reflect/Method::getGenericParameterTypes method) array.to-list (monad.map try.monad reflection!.type) - ////.lift) + phase.lift) #let [modifiers (java/lang/reflect/Method::getModifiers method) correct-class? (java/lang/Object::equals class (java/lang/reflect/Method::getDeclaringClass method)) correct-method? (text@= method-name (java/lang/reflect/Method::getName method)) @@ -1071,11 +1073,11 @@ (def: (check-constructor aliasing class inputsJT constructor) (-> Aliasing (java/lang/Class java/lang/Object) (List (Type Value)) (java/lang/reflect/Constructor java/lang/Object) (Operation Bit)) - (do ////.monad + (do phase.monad [parameters (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor) array.to-list (monad.map try.monad reflection!.type) - ////.lift)] + phase.lift)] (wrap (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor)) (n.= (list.size inputsJT) (list.size parameters)) (list@fold (function (_ [expectedJC actualJC] prev) @@ -1126,23 +1128,23 @@ array.to-list (list@map (|>> java/lang/reflect/TypeVariable::getName))) [owner-tvarsT mapping] (jvm-type-var-mapping owner-tvars method-tvars)] - (do ////.monad + (do phase.monad [inputsT (|> (java/lang/reflect/Method::getGenericParameterTypes method) array.to-list - (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (..reflection-type mapping))) - ////@join) + (monad.map @ (|>> reflection!.type phase.lift)) + (phase@map (monad.map @ (..reflection-type mapping))) + phase@join) outputT (|> method java/lang/reflect/Method::getGenericReturnType reflection!.return - ////.lift - (////@map (..reflection-return mapping)) - ////@join) + phase.lift + (phase@map (..reflection-return mapping)) + phase@join) exceptionsT (|> (java/lang/reflect/Method::getGenericExceptionTypes method) array.to-list - (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (..reflection-type mapping))) - ////@join) + (monad.map @ (|>> reflection!.type phase.lift)) + (phase@map (monad.map @ (..reflection-type mapping))) + phase@join) #let [methodT (<| (type.univ-q (dictionary.size mapping)) (type.function (case method-style #Static @@ -1164,17 +1166,17 @@ array.to-list (list@map (|>> java/lang/reflect/TypeVariable::getName))) [owner-tvarsT mapping] (jvm-type-var-mapping owner-tvars method-tvars)] - (do ////.monad + (do phase.monad [inputsT (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor) array.to-list - (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (reflection-type mapping))) - ////@join) + (monad.map @ (|>> reflection!.type phase.lift)) + (phase@map (monad.map @ (reflection-type mapping))) + phase@join) exceptionsT (|> (java/lang/reflect/Constructor::getGenericExceptionTypes constructor) array.to-list - (monad.map @ (|>> reflection!.type ////.lift)) - (////@map (monad.map @ (reflection-type mapping))) - ////@join) + (monad.map @ (|>> reflection!.type phase.lift)) + (phase@map (monad.map @ (reflection-type mapping))) + phase@join) #let [objectT (#.Primitive (java/lang/Class::getName owner) owner-tvarsT) constructorT (<| (type.univ-q (dictionary.size mapping)) (type.function inputsT) @@ -1218,8 +1220,8 @@ (def: (method-candidate actual-class-tvars class-name actual-method-tvars method-name method-style inputsJT) (-> (List (Type Var)) External (List (Type Var)) Text Method-Style (List (Type Value)) (Operation Method-Signature)) - (do ////.monad - [class (////.lift (reflection!.load class-name)) + (do phase.monad + [class (phase.lift (reflection!.load class-name)) #let [expected-class-tvars (class-type-variables class)] candidates (|> class java/lang/Class::getDeclaredMethods @@ -1250,8 +1252,8 @@ (def: (constructor-candidate actual-class-tvars class-name actual-method-tvars inputsJT) (-> (List (Type Var)) External (List (Type Var)) (List (Type Value)) (Operation Method-Signature)) - (do ////.monad - [class (////.lift (reflection!.load class-name)) + (do phase.monad + [class (phase.lift (reflection!.load class-name)) #let [expected-class-tvars (class-type-variables class)] candidates (|> class java/lang/Class::getConstructors @@ -1304,7 +1306,7 @@ (..custom [($_ <>.and ..type-vars ..member ..type-vars (<>.some ..input)) (function (_ extension-name analyse [class-tvars [class method] method-tvars argsTC]) - (do ////.monad + (do phase.monad [#let [argsT (list@map product.left argsTC)] [methodT exceptionsT] (method-candidate class-tvars class method-tvars method #Static argsT) [outputT argsA] (inferenceA.general analyse methodT (list@map product.right argsTC)) @@ -1319,7 +1321,7 @@ (..custom [($_ <>.and ..type-vars ..member ..type-vars <c>.any (<>.some ..input)) (function (_ extension-name analyse [class-tvars [class method] method-tvars objectC argsTC]) - (do ////.monad + (do phase.monad [#let [argsT (list@map product.left argsTC)] [methodT exceptionsT] (method-candidate class-tvars class method-tvars method #Virtual argsT) [outputT allA] (inferenceA.general analyse methodT (list& objectC (list@map product.right argsTC))) @@ -1341,7 +1343,7 @@ (..custom [($_ <>.and ..type-vars ..member ..type-vars <c>.any (<>.some ..input)) (function (_ extension-name analyse [class-tvars [class method] method-tvars objectC argsTC]) - (do ////.monad + (do phase.monad [#let [argsT (list@map product.left argsTC)] [methodT exceptionsT] (method-candidate class-tvars class method-tvars method #Special argsT) [outputT argsA] (inferenceA.general analyse methodT (list& objectC (list@map product.right argsTC))) @@ -1356,11 +1358,11 @@ (..custom [($_ <>.and ..type-vars ..member ..type-vars <c>.any (<>.some ..input)) (function (_ extension-name analyse [class-tvars [class-name method] method-tvars objectC argsTC]) - (do ////.monad + (do phase.monad [#let [argsT (list@map product.left argsTC)] - class (////.lift (reflection!.load class-name)) - _ (////.assert non-interface class-name - (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers class))) + class (phase.lift (reflection!.load class-name)) + _ (phase.assert non-interface class-name + (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers class))) [methodT exceptionsT] (method-candidate class-tvars class-name method-tvars method #Interface argsT) [outputT allA] (inferenceA.general analyse methodT (list& objectC (list@map product.right argsTC))) #let [[objectA argsA] (case allA @@ -1381,7 +1383,7 @@ (..custom [($_ <>.and ..type-vars <c>.text ..type-vars (<>.some ..input)) (function (_ extension-name analyse [class-tvars class method-tvars argsTC]) - (do ////.monad + (do phase.monad [#let [argsT (list@map product.left argsTC)] [methodT exceptionsT] (constructor-candidate class-tvars class method-tvars argsT) [outputT argsA] (inferenceA.general analyse methodT (list@map product.right argsTC))] @@ -1573,7 +1575,7 @@ (let [[visibility strict-fp? annotations vars exceptions self-name arguments super-arguments body] method] - (do ////.monad + (do phase.monad [annotationsA (monad.map @ (function (_ [name parameters]) (do @ [parametersA (monad.map @ (function (_ [name value]) @@ -1654,7 +1656,7 @@ final? strict-fp? annotations vars self-name arguments return exceptions body] method] - (do ////.monad + (do phase.monad [annotationsA (monad.map @ (function (_ [name parameters]) (do @ [parametersA (monad.map @ (function (_ [name value]) @@ -1727,7 +1729,7 @@ strict-fp? annotations vars exceptions arguments return body] method] - (do ////.monad + (do phase.monad [annotationsA (monad.map @ (function (_ [name parameters]) (do @ [parametersA (monad.map @ (function (_ [name value]) @@ -1801,7 +1803,7 @@ strict-fp? annotations vars self-name arguments return exceptions body] method] - (do ////.monad + (do phase.monad [annotationsA (monad.map @ (function (_ [name parameters]) (do @ [parametersA (monad.map @ (function (_ [name value]) @@ -1875,15 +1877,15 @@ (def: (super-aliasing class) (-> (Type Class) (Operation Aliasing)) - (do ////.monad + (do phase.monad [#let [[name actual-parameters] (jvm-parser.read-class class)] - class (////.lift (reflection!.load name)) + class (phase.lift (reflection!.load name)) #let [expected-parameters (|> (java/lang/Class::getTypeParameters class) array.to-list (list@map (|>> java/lang/reflect/TypeVariable::getName)))] - _ (////.assert ..class-parameter-mismatch [expected-parameters actual-parameters] - (n.= (list.size expected-parameters) - (list.size actual-parameters)))] + _ (phase.assert ..class-parameter-mismatch [expected-parameters actual-parameters] + (n.= (list.size expected-parameters) + (list.size actual-parameters)))] (wrap (|> (list.zip2 expected-parameters actual-parameters) (list@fold (function (_ [expected actual] mapping) (case (jvm-parser.var? actual) @@ -1914,7 +1916,7 @@ super-interfaces constructor-args methods]) - (do ////.monad + (do phase.monad [parameters (typeA.with-env (..parameter-types parameters)) #let [mapping (list@fold (function (_ [parameterJ parameterT] mapping) @@ -1944,8 +1946,8 @@ (wrap [type termA]))) constructor-args) methodsA (monad.map @ (analyse-overriden-method analyse selfT mapping) methods) - required-abstract-methods (////.lift (all-abstract-methods (list& super-class super-interfaces))) - available-methods (////.lift (all-methods (list& super-class super-interfaces))) + required-abstract-methods (phase.lift (all-abstract-methods (list& super-class super-interfaces))) + available-methods (phase.lift (all-methods (list& super-class super-interfaces))) overriden-methods (monad.map @ (function (_ [parent-type method-name strict-fp? annotations vars self-name arguments return exceptions @@ -1960,10 +1962,10 @@ #let [missing-abstract-methods (mismatched-methods overriden-methods required-abstract-methods) invalid-overriden-methods (mismatched-methods available-methods overriden-methods)] _ (typeA.infer selfT) - _ (////.assert ..missing-abstract-methods missing-abstract-methods - (list.empty? missing-abstract-methods)) - _ (////.assert ..invalid-overriden-methods invalid-overriden-methods - (list.empty? invalid-overriden-methods))] + _ (phase.assert ..missing-abstract-methods missing-abstract-methods + (list.empty? missing-abstract-methods)) + _ (phase.assert ..invalid-overriden-methods invalid-overriden-methods + (list.empty? invalid-overriden-methods))] (wrap (#/////analysis.Extension extension-name (list (/////analysis.text name) (class-analysis super-class) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/lux.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux index 0ddda71cf..5a813c253 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/lux.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux @@ -22,14 +22,16 @@ ["." macro]] ["." /// ["#." bundle] - ["#/" // + ["/#" // #_ [analysis [".A" type] [".A" case] [".A" function]] - ["#/" // + [// ["#." analysis (#+ Analysis Operation Phase Handler Bundle) - [evaluation (#+ Eval)]]]]]) + [evaluation (#+ Eval)]] + [/// + ["#" phase]]]]]) (def: #export (custom [syntax handler]) (All [s] @@ -42,7 +44,7 @@ (handler extension-name analyse inputs) (#try.Failure _) - (/////analysis.throw ///.invalid-syntax [extension-name %.code args])))) + (////analysis.throw ///.invalid-syntax [extension-name %.code args])))) (def: (simple inputsT+ outputT) (-> (List Type) Type Handler) @@ -57,8 +59,8 @@ (typeA.with-type argT (analyse argC))) (list.zip2 inputsT+ args))] - (wrap (#/////analysis.Extension extension-name argsA))) - (/////analysis.throw ///.incorrect-arity [extension-name num-expected num-actual])))))) + (wrap (#////analysis.Extension extension-name argsA))) + (////analysis.throw ///.incorrect-arity [extension-name num-expected num-actual])))))) (def: #export (nullary valueT) (-> Type Handler) @@ -112,11 +114,11 @@ (phase else))] (wrap (|> conditionals (list@map (function (_ [cases branch]) - (/////analysis.tuple - (list (/////analysis.tuple (list@map (|>> /////analysis.nat) cases)) + (////analysis.tuple + (list (////analysis.tuple (list@map (|>> ////analysis.nat) cases)) branch)))) (list& input else) - (#/////analysis.Extension extension-name)))))]))) + (#////analysis.Extension extension-name)))))]))) ## "lux is" represents reference/pointer equality. (def: lux::is @@ -139,21 +141,21 @@ _ (typeA.infer (type (Either Text varT))) opA (typeA.with-type (type (IO varT)) (analyse opC))] - (wrap (#/////analysis.Extension extension-name (list opA)))) + (wrap (#////analysis.Extension extension-name (list opA)))) _ - (/////analysis.throw ///.incorrect-arity [extension-name 1 (list.size args)])))) + (////analysis.throw ///.incorrect-arity [extension-name 1 (list.size args)])))) (def: lux::in-module Handler (function (_ extension-name analyse argsC+) (case argsC+ (^ (list [_ (#.Text module-name)] exprC)) - (/////analysis.with-current-module module-name + (////analysis.with-current-module module-name (analyse exprC)) _ - (/////analysis.throw ///.invalid-syntax [extension-name %.code argsC+])))) + (////analysis.throw ///.invalid-syntax [extension-name %.code argsC+])))) (def: (lux::check eval) (-> Eval Handler) @@ -169,7 +171,7 @@ (analyse valueC))) _ - (/////analysis.throw ///.incorrect-arity [extension-name 2 (list.size args)])))) + (////analysis.throw ///.incorrect-arity [extension-name 2 (list.size args)])))) (def: (lux::coerce eval) (-> Eval Handler) @@ -186,7 +188,7 @@ (wrap valueA)) _ - (/////analysis.throw ///.incorrect-arity [extension-name 2 (list.size args)])))) + (////analysis.throw ///.incorrect-arity [extension-name 2 (list.size args)])))) (def: (caster input output) (-> Type Type Handler) @@ -199,7 +201,7 @@ (analyse valueC))) _ - (/////analysis.throw ///.incorrect-arity [extension-name 1 (list.size args)])))) + (////analysis.throw ///.incorrect-arity [extension-name 1 (list.size args)])))) (def: (bundle::lux eval) (-> Eval Bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/bundle.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/bundle.lux index 4816993f3..4816993f3 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/bundle.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/bundle.lux diff --git a/stdlib/source/lux/tool/compiler/phase/extension/directive/jvm.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux index 4db15e8e6..4db15e8e6 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/directive/jvm.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux diff --git a/stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux index 084bc8080..3d79c84c1 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/directive/lux.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux @@ -22,17 +22,19 @@ ["." /// (#+ Extender) ["#." bundle] ["#." analysis] - ["#/" // + ["/#" // #_ [analysis ["." module] [".A" type]] - ["#/" // #_ + ["/#" // #_ ["#." analysis [macro (#+ Expander)] ["#/." evaluation]] ["#." synthesis (#+ Synthesis)] ["#." generation] - ["#." directive (#+ Import Requirements Phase Operation Handler Bundle)]]]]) + ["#." directive (#+ Import Requirements Phase Operation Handler Bundle)] + [/// + ["." phase]]]]]) (def: #export (custom [syntax handler]) (All [anchor expression directive s] @@ -48,7 +50,7 @@ (handler extension-name phase inputs) (#try.Failure error) - (////.throw ///.invalid-syntax [extension-name %.code inputs])))) + (phase.throw ///.invalid-syntax [extension-name %.code inputs])))) ## TODO: Inline "evaluate!'" into "evaluate!" ASAP (def: (evaluate!' generate code//type codeS) @@ -58,7 +60,7 @@ Synthesis (Operation anchor expression directive [Type expression Any]))) (/////directive.lift-generation - (do ////.monad + (do phase.monad [codeT (generate codeS) id /////generation.next codeV (/////generation.evaluate! (format "evaluate" (%.nat id)) codeT)] @@ -67,8 +69,8 @@ (def: #export (evaluate! type codeC) (All [anchor expression directive] (-> Type Code (Operation anchor expression directive [Type expression Any]))) - (do ////.monad - [state (///.lift ////.get-state) + (do phase.monad + [state (///.lift phase.get-state) #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state) synthesize (get@ [#/////directive.synthesis #/////directive.phase] state) generate (get@ [#/////directive.generation #/////directive.phase] state)] @@ -90,7 +92,7 @@ Synthesis (Operation anchor expression directive [Type expression Text Any]))) (/////directive.lift-generation - (do ////.monad + (do phase.monad [codeT (generate codeS) [target-name value directive] (/////generation.define! name codeT) _ (/////generation.save! false name directive)] @@ -100,8 +102,8 @@ (All [anchor expression directive] (-> Name (Maybe Type) Code (Operation anchor expression directive [Type expression Text Any]))) - (do ////.monad - [state (///.lift ////.get-state) + (do phase.monad + [state (///.lift phase.get-state) #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state) synthesize (get@ [#/////directive.synthesis #/////directive.phase] state) generate (get@ [#/////directive.generation #/////directive.phase] state)] @@ -128,25 +130,25 @@ (def: (refresh expander host-analysis) (All [anchor expression directive] (-> Expander /////analysis.Bundle (Operation anchor expression directive Any))) - (do ////.monad - [[bundle state] ////.get-state + (do phase.monad + [[bundle state] phase.get-state #let [eval (/////analysis/evaluation.evaluator expander (get@ [#/////directive.synthesis #/////directive.state] state) (get@ [#/////directive.generation #/////directive.state] state) (get@ [#/////directive.generation #/////directive.phase] state))]] - (////.set-state [bundle - (update@ [#/////directive.analysis #/////directive.state] - (: (-> /////analysis.State+ /////analysis.State+) - (|>> product.right - [(///analysis.bundle eval host-analysis)])) - state)]))) + (phase.set-state [bundle + (update@ [#/////directive.analysis #/////directive.state] + (: (-> /////analysis.State+ /////analysis.State+) + (|>> product.right + [(///analysis.bundle eval host-analysis)])) + state)]))) (def: (lux::def expander host-analysis) (-> Expander /////analysis.Bundle Handler) (function (_ extension-name phase inputsC+) (case inputsC+ (^ (list [_ (#.Identifier ["" short-name])] valueC annotationsC [_ (#.Bit exported?)])) - (do ////.monad + (do phase.monad [current-module (/////directive.lift-analysis (///.lift macro.current-module-name)) #let [full-name [current-module short-name]] @@ -161,14 +163,14 @@ (wrap /////directive.no-requirements)) _ - (////.throw ///.invalid-syntax [extension-name %.code inputsC+])))) + (phase.throw ///.invalid-syntax [extension-name %.code inputsC+])))) (def: (def::type-tagged expander host-analysis) (-> Expander /////analysis.Bundle Handler) (..custom [($_ p.and s.local-identifier s.any s.any (s.tuple (p.some s.text)) s.bit) (function (_ extension-name phase [short-name valueC annotationsC tags exported?]) - (do ////.monad + (do phase.monad [current-module (/////directive.lift-analysis (///.lift macro.current-module-name)) #let [full-name [current-module short-name]] @@ -176,7 +178,7 @@ #let [annotations (:coerce Code annotations)] [type valueT valueN value] (..definition full-name (#.Some .Type) valueC) _ (/////directive.lift-analysis - (do ////.monad + (do phase.monad [_ (module.define short-name (#.Right [exported? type annotations value]))] (module.declare-tags tags exported? (:coerce Type value)))) #let [_ (log! (format "Definition " (%.name full-name)))] @@ -196,7 +198,7 @@ (..custom [($_ p.and s.any ..imports) (function (_ extension-name phase [annotationsC imports]) - (do ////.monad + (do phase.monad [[_ annotationsT annotationsV] (evaluate! Code annotationsC) #let [annotationsV (:coerce Code annotationsV)] _ (/////directive.lift-analysis @@ -220,12 +222,12 @@ (def: (define-alias alias original) (-> Text Name (/////analysis.Operation Any)) - (do ////.monad + (do phase.monad [current-module (///.lift macro.current-module-name) constant (///.lift (macro.find-def original))] (case constant (#.Left de-aliased) - (////.throw ..cannot-alias-an-alias [[current-module alias] original de-aliased]) + (phase.throw ..cannot-alias-an-alias [[current-module alias] original de-aliased]) (#.Right [exported? original-type original-annotations original-value]) (module.define alias (#.Left original))))) @@ -235,11 +237,11 @@ (..custom [($_ p.and s.local-identifier s.identifier) (function (_ extension-name phase [alias def-name]) - (do ////.monad + (do phase.monad [_ (///.lift - (////.sub [(get@ [#/////directive.analysis #/////directive.state]) - (set@ [#/////directive.analysis #/////directive.state])] - (define-alias alias def-name)))] + (phase.sub [(get@ [#/////directive.analysis #/////directive.state]) + (set@ [#/////directive.analysis #/////directive.state])] + (define-alias alias def-name)))] (wrap /////directive.no-requirements)))])) (template [<description> <mame> <type> <scope>] @@ -250,7 +252,7 @@ (function (handler extension-name phase inputsC+) (case inputsC+ (^ (list nameC valueC)) - (do ////.monad + (do phase.monad [[_ _ name] (evaluate! Text nameC) [_ _ handlerV] (evaluate! (:by-example [anchor expression directive] {(Handler anchor expression directive) @@ -268,7 +270,7 @@ (wrap /////directive.no-requirements)) _ - (////.throw ///.invalid-syntax [extension-name %.code inputsC+]))))] + (phase.throw ///.invalid-syntax [extension-name %.code inputsC+]))))] ["Analysis" def::analysis /////analysis.Handler /////directive.lift-analysis] ["Synthesis" def::synthesis /////synthesis.Handler /////directive.lift-synthesis] @@ -285,7 +287,7 @@ /////synthesis.Phase Code (Operation anchor expression directive Synthesis))) - (do ////.monad + (do phase.monad [[_ programA] (/////directive.lift-analysis (/////analysis.with-scope (typeA.with-fresh-env @@ -300,7 +302,7 @@ (-> expression directive) Synthesis (/////generation.Operation anchor expression directive Any))) - (do ////.monad + (do phase.monad [programG (generate programS)] (/////generation.save! false ["" ""] (program programG)))) @@ -310,8 +312,8 @@ (function (handler extension-name phase inputsC+) (case inputsC+ (^ (list programC)) - (do ////.monad - [state (///.lift ////.get-state) + (do phase.monad + [state (///.lift phase.get-state) #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state) synthesize (get@ [#/////directive.synthesis #/////directive.phase] state) generate (get@ [#/////directive.generation #/////directive.phase] state)] @@ -321,7 +323,7 @@ (wrap /////directive.no-requirements)) _ - (////.throw ///.invalid-syntax [extension-name %.code inputsC+])))) + (phase.throw ///.invalid-syntax [extension-name %.code inputsC+])))) (def: (bundle::def expander host-analysis program extender) (All [anchor expression directive] diff --git a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm.lux index 93816d128..93816d128 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm.lux diff --git a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux index c666c1df5..8bfdb9193 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux @@ -23,22 +23,22 @@ ["." signed (#+ S4)]] ["." type (#+ Type) [category (#+ Primitive Class)]]]]] - [///// + ["." ///// #_ [generation + [extension (#+ Nullary Unary Binary Trinary Variadic + nullary unary binary trinary variadic)] ["///" jvm #_ ["#." value] ["#." runtime (#+ Operation Phase Bundle Handler)] ["#." function #_ - ["#" abstract]] - ["//#" /// - [generation - [extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)]] - [extension - ["#extension" /] - ["#." bundle]] - ["/#" // - ["#." synthesis (#+ Synthesis %synthesis)]]]]]]) + ["#" abstract]]]] + [extension + ["#extension" /] + ["#." bundle]] + [// + ["/#." synthesis (#+ Synthesis %synthesis)] + [/// + ["#" phase]]]]) (def: #export (custom [parser handler]) (All [s] diff --git a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/host.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux index 6c8253c12..b1c55f555 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -39,30 +39,30 @@ ["." reflection] ["." signature] ["." parser]]]]] - [// + ["." // #_ [common (#+ custom)] - [//// + ["///#" //// #_ [generation + [extension (#+ Nullary Unary Binary Trinary Variadic + nullary unary binary trinary variadic)] ["///" jvm [runtime (#+ Operation Bundle Handler)] ["#." reference] [function [field [variable - ["." foreign]]]] - ["//#" /// - [generation - [extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)]] - [extension - ["#." bundle] - [analysis - ["/" jvm]]] - ["/#" // - ["#." reference (#+ Variable)] - [analysis (#+ Environment)] - ["#." synthesis (#+ Synthesis Path %synthesis)] - ["#." generation]]]]]]]) + ["." foreign]]]]]] + [extension + ["#." bundle] + [analysis + ["/" jvm]]] + ["/#" // #_ + [analysis (#+ Environment)] + ["#." synthesis (#+ Synthesis Path %synthesis)] + ["#." generation] + [/// + ["#" phase] + ["#." reference (#+ Variable)]]]]]) (template [<name> <0> <1>] [(def: <name> @@ -350,7 +350,7 @@ (..custom [<s>.any (function (_ extension-name generate arrayS) - (do /////.monad + (do //////.monad [arrayG (generate arrayS)] (wrap ($_ _.compose arrayG @@ -362,7 +362,7 @@ (..custom [($_ <>.and ..object-array <s>.any) (function (_ extension-name generate [elementJT arrayS]) - (do /////.monad + (do //////.monad [arrayG (generate arrayS)] (wrap ($_ _.compose arrayG @@ -374,7 +374,7 @@ (..custom [<s>.any (function (_ extension-name generate [lengthS]) - (do /////.monad + (do //////.monad [lengthG (generate lengthS)] (wrap ($_ _.compose lengthG @@ -385,7 +385,7 @@ (..custom [($_ <>.and ..object <s>.any) (function (_ extension-name generate [objectJT lengthS]) - (do /////.monad + (do //////.monad [lengthG (generate lengthS)] (wrap ($_ _.compose lengthG @@ -396,7 +396,7 @@ (..custom [($_ <>.and <s>.any <s>.any) (function (_ extension-name generate [idxS arrayS]) - (do /////.monad + (do //////.monad [arrayG (generate arrayS) idxG (generate idxS)] (wrap ($_ _.compose @@ -410,7 +410,7 @@ (..custom [($_ <>.and ..object-array <s>.any <s>.any) (function (_ extension-name generate [elementJT idxS arrayS]) - (do /////.monad + (do //////.monad [arrayG (generate arrayS) idxG (generate idxS)] (wrap ($_ _.compose @@ -424,7 +424,7 @@ (..custom [($_ <>.and <s>.any <s>.any <s>.any) (function (_ extension-name generate [idxS valueS arrayS]) - (do /////.monad + (do //////.monad [arrayG (generate arrayS) idxG (generate idxS) valueG (generate valueS)] @@ -441,7 +441,7 @@ (..custom [($_ <>.and ..object-array <s>.any <s>.any <s>.any) (function (_ extension-name generate [elementJT idxS valueS arrayS]) - (do /////.monad + (do //////.monad [arrayG (generate arrayS) idxG (generate idxS) valueG (generate valueS)] @@ -545,7 +545,7 @@ (..custom [<s>.text (function (_ extension-name generate [class]) - (do /////.monad + (do //////.monad [] (wrap ($_ _.compose (_.string class) @@ -556,7 +556,7 @@ (..custom [($_ <>.and <s>.text <s>.any) (function (_ extension-name generate [class objectS]) - (do /////.monad + (do //////.monad [objectG (generate objectS)] (wrap ($_ _.compose objectG @@ -573,7 +573,7 @@ (..custom [($_ <>.and <s>.text <s>.text <s>.any) (function (_ extension-name generate [from to valueS]) - (do /////.monad + (do //////.monad [valueG (generate valueS)] (wrap (`` (cond (~~ (template [<object> <type> <unwrap>] [(and (text@= (..reflection <type>) @@ -636,7 +636,7 @@ (..custom [($_ <>.and <s>.text <s>.text <s>.text) (function (_ extension-name generate [class field unboxed]) - (do /////.monad + (do //////.monad [#let [$class (type.class class (list))]] (case (dictionary.get unboxed ..primitives) (#.Some primitive) @@ -652,7 +652,7 @@ (..custom [($_ <>.and <s>.text <s>.text <s>.text <s>.any) (function (_ extension-name generate [class field unboxed valueS]) - (do /////.monad + (do //////.monad [valueG (generate valueS) #let [$class (type.class class (list))]] (case (dictionary.get unboxed ..primitives) @@ -674,7 +674,7 @@ (..custom [($_ <>.and <s>.text <s>.text <s>.text <s>.any) (function (_ extension-name generate [class field unboxed objectS]) - (do /////.monad + (do //////.monad [objectG (generate objectS) #let [$class (type.class class (list)) getG (case (dictionary.get unboxed ..primitives) @@ -693,7 +693,7 @@ (..custom [($_ <>.and <s>.text <s>.text <s>.text <s>.any <s>.any) (function (_ extension-name generate [class field unboxed valueS objectS]) - (do /////.monad + (do //////.monad [valueG (generate valueS) objectG (generate objectS) #let [$class (type.class class (list)) @@ -722,7 +722,7 @@ (def: (generate-input generate [valueT valueS]) (-> (-> Synthesis (Operation (Bytecode Any))) Input (Operation (Typed (Bytecode Any)))) - (do /////.monad + (do //////.monad [valueG (generate valueS)] (case (type.primitive? valueT) (#.Right valueT) @@ -747,7 +747,7 @@ (..custom [($_ <>.and ..class <s>.text ..return (<>.some ..input)) (function (_ extension-name generate [class method outputT inputsTS]) - (do /////.monad + (do //////.monad [inputsTG (monad.map @ (generate-input generate) inputsTS)] (wrap ($_ _.compose (monad.map _.monad product.right inputsTG) @@ -760,7 +760,7 @@ (..custom [($_ <>.and ..class <s>.text ..return <s>.any (<>.some ..input)) (function (_ extension-name generate [class method outputT objectS inputsTS]) - (do /////.monad + (do //////.monad [objectG (generate objectS) inputsTG (monad.map @ (generate-input generate) inputsTS)] (wrap ($_ _.compose @@ -780,7 +780,7 @@ (..custom [($_ <>.and ..class (<>.some ..input)) (function (_ extension-name generate [class inputsTS]) - (do /////.monad + (do //////.monad [inputsTG (monad.map @ (generate-input generate) inputsTS)] (wrap ($_ _.compose (_.new class) @@ -944,7 +944,7 @@ (def: (anonymous-instance class env) (-> (Type category.Class) Environment (Operation (Bytecode Any))) - (do /////.monad + (do //////.monad [captureG+ (monad.map @ ///reference.variable env)] (wrap ($_ _.compose (_.new class) @@ -995,7 +995,7 @@ super-class super-interfaces inputsTS overriden-methods]) - (do /////.monad + (do //////.monad [#let [class (type.class class-name (list)) total-environment (|> overriden-methods ## Get all the environments. @@ -1053,7 +1053,7 @@ (returnG returnT))))))) normalized-methods) bytecode (<| (:: @ map (format.run class.writer)) - /////.lift + //////.lift (class.class version.v6_0 ($_ modifier@compose class.public class.final) (name.internal class-name) (name.internal (..reflection super-class)) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/synthesis.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/synthesis.lux index 40fb4f89e..40fb4f89e 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/synthesis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/synthesis.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux index 6d3500416..6d3500416 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux index 6fdb37e34..6fdb37e34 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension/common.lux index 0d56d70b6..0d56d70b6 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux index 3dcc24448..3dcc24448 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux index a00fc2b12..a00fc2b12 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/primitive.lux index 4177f814a..4177f814a 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/reference.lux index 206f3f0e9..206f3f0e9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux index 19594bac9..19594bac9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/structure.lux index ef29d33dc..ef29d33dc 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/common-lisp/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/common-lisp/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/extension.lux index d0de3e920..2847fa805 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/extension.lux @@ -11,11 +11,13 @@ ["." macro (#+ with-gensyms) ["." code] [syntax (#+ syntax:)]]] - ["." /// + ["." /// #_ ["#." extension] [// [synthesis (#+ Synthesis)] - ["." generation]]]) + ["." generation] + [/// + ["#" phase]]]]) (syntax: (Vector {size s.nat} elemT) (wrap (list (` [(~+ (list.repeat size elemT))])))) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js.lux index c0cd734b3..c0cd734b3 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux index d9956579c..d9956579c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension.lux index 71739bfc9..71739bfc9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/common.lux index c5c4d15ff..c5c4d15ff 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/host.lux index c44e1bdff..c44e1bdff 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/extension/host.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux index ec48162c5..ec48162c5 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux index 101c49b95..101c49b95 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/primitive.lux index 09341fd59..09341fd59 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/reference.lux index 4ac7483fa..4ac7483fa 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux index 949e663c7..949e663c7 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux index c721c991c..c721c991c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/js/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm.lux index eed30cf71..a5a9c9141 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm.lux @@ -10,12 +10,14 @@ ["#." function] ["#." case] ["#." loop] - ["//#" /// + ["//#" /// #_ ["#." extension] [// [analysis (#+)] ["." synthesis] - ["." reference]]]]) + [/// + ["." reference] + ["#" phase]]]]]) (def: #export (generate synthesis) Phase diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux index 7f33f383b..244614688 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux @@ -18,10 +18,11 @@ ["#." runtime (#+ Operation Phase)] ["#." value] [//// - [reference (#+ Register)] ["." synthesis (#+ Path Synthesis)] ["." generation] - ["." phase ("operation@." monad)]]]) + [/// + [reference (#+ Register)] + ["." phase ("operation@." monad)]]]]) (def: equals-name "equals") diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/debug.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/debug.lux index 142c46224..142c46224 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/debug.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/debug.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux index 8e7d51475..a06d127ac 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux @@ -44,12 +44,13 @@ ["/#" // #_ ["#." runtime (#+ Operation Phase)] [//// - ["." arity (#+ Arity)] - [reference (#+ Register)] [analysis (#+ Environment)] [synthesis (#+ Synthesis Abstraction Apply)] ["." generation] - ["." phase]]]]) + [/// + [reference (#+ Register)] + ["." arity (#+ Arity)] + ["." phase]]]]]) (def: #export (with @begin class environment arity body) (-> Label External Environment Arity (Bytecode Any) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/abstract.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/abstract.lux index 419fca601..419fca601 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/abstract.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/abstract.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux index dd8144ea8..dd8144ea8 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant/arity.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux index d4d1a2a68..011535ce9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/constant/arity.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux @@ -7,7 +7,7 @@ [constant [pool (#+ Resource)]]]]] ["." // - [/////// + [///////// [arity (#+ Arity)]]]) (def: #export name "arity") diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux index 30ed3a524..c491039b9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux @@ -16,7 +16,7 @@ ["." //// #_ ["#." type] ["#." reference] - [//// + [////// [reference (#+ Register)]]]) (def: #export type ////type.value) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/foreign.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux index 8df5c304c..b9e97ddfd 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/foreign.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/foreign.lux @@ -16,8 +16,9 @@ ["///#" //// #_ ["#." reference] [//// - [reference (#+ Register)] - [analysis (#+ Environment)]]]]) + [analysis (#+ Environment)] + [/// + [reference (#+ Register)]]]]]) (def: #export (closure environment) (-> Environment (List (Type Value))) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux index 62bb75c23..b44cb4102 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial.lux @@ -24,7 +24,7 @@ ["#." arity]] ["//#" /// #_ ["#." reference] - [//// + [////// [reference (#+ Register)] ["." arity (#+ Arity)]]]]]]) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial/count.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial/count.lux index 579a63992..579a63992 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/variable/partial/count.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable/partial/count.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux index 2fd419d18..2fd419d18 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux index ba9b80add..592c798ec 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux @@ -40,8 +40,9 @@ ["#." reference] [//// [analysis (#+ Environment)] - [arity (#+ Arity)] - ["." reference (#+ Register)]]]]]) + [/// + [arity (#+ Arity)] + ["." reference (#+ Register)]]]]]]) (def: (increment by) (-> Nat (Bytecode Any)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/implementation.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux index a0e606194..000bdf569 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/implementation.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/implementation.lux @@ -14,7 +14,7 @@ ["." // ["//#" /// #_ ["#." type] - [//// + [////// [arity (#+ Arity)]]]]) (def: #export name "impl") diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux index 7308c0734..5c39bd145 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux @@ -33,9 +33,10 @@ ["#." type] ["#." reference] [//// - [reference (#+ Register)] [analysis (#+ Environment)] - ["." arity (#+ Arity)]]]]]) + [/// + [reference (#+ Register)] + ["." arity (#+ Arity)]]]]]]) (def: #export name "<init>") diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux index ac1347c2d..a307650dd 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux @@ -33,8 +33,9 @@ ["#." reference] [//// [analysis (#+ Environment)] - ["." arity (#+ Arity)] - ["." phase]]]]]) + [/// + ["." arity (#+ Arity)] + ["." phase]]]]]]) (def: #export (instance' foreign-setup class environment arity) (-> (List (Bytecode Any)) (Type Class) Environment Arity (Bytecode Any)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux index c196208bc..66cdda752 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux @@ -21,7 +21,8 @@ ["#." reference] [//// [analysis (#+ Environment)] - ["." arity (#+ Arity)]]]]]) + [/// + ["." arity (#+ Arity)]]]]]]) (def: #export name "reset") diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/host.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux index 86b9aa095..86b9aa095 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/host.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux index 00ceb8ca4..ac0cd300d 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux @@ -17,10 +17,11 @@ ["#." runtime (#+ Operation Phase)] ["#." value] [//// - [reference (#+ Register)] ["." synthesis (#+ Path Synthesis)] ["." generation] - ["." phase]]]) + [/// + [reference (#+ Register)] + ["." phase]]]]) (def: (invariant? register changeS) (-> Register Synthesis Bit) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/packager.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/packager.lux index 983ac3d1a..6a317699c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/packager.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/packager.lux @@ -17,9 +17,10 @@ [runtime (#+ Definition)] [//// [generation (#+ Buffer Output)] - [meta - [archive - [descriptor (#+ Module)]]]]]) + [/// + [meta + [archive + [descriptor (#+ Module)]]]]]]) (import: #long java/lang/Object) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux index f49c3b517..f49c3b517 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/program.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux index c5f10a9a6..c5f10a9a6 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/program.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux index 59115f815..6cec91906 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux @@ -15,10 +15,12 @@ [runtime (#+ Operation)] ["#." value] ["#." type] - ["//#" /// ("operation@." monad) + ["//#" /// #_ [// - ["." reference (#+ Register Variable)] - ["." generation]]]]) + ["." generation] + [/// + ["#" phase ("operation@." monad)] + ["." reference (#+ Register Variable)]]]]]) (def: #export this (Bytecode Any) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux index bd9cc1850..1ad86b82c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux @@ -41,12 +41,14 @@ [variable [partial ["#/." count]]]]] - ["//#" /// + ["//#" /// #_ [// - [arity (#+ Arity)] - [reference (#+ Register)] ["." synthesis] - ["." generation]]]]) + ["." generation] + [/// + ["#" phase] + [arity (#+ Arity)] + [reference (#+ Register)]]]]]) (type: #export Byte-Code Binary) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux index 0b5ebb5e7..23acad65c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux @@ -14,10 +14,11 @@ ["." // #_ ["#." runtime (#+ Operation Phase Generator)] ["#." primitive] - ["#//" /// - ["#/" // #_ - [analysis (#+ Variant Tuple)] - ["#." synthesis (#+ Synthesis)]]]]) + ["///#" //// #_ + [analysis (#+ Variant Tuple)] + ["#." synthesis (#+ Synthesis)] + [/// + ["." phase]]]]) (def: $Object (type.class "java.lang.Object" (list))) @@ -27,13 +28,13 @@ (Generator (Tuple Synthesis)) (case membersS #.Nil - (:: ////.monad wrap ..unitG) + (:: phase.monad wrap ..unitG) (#.Cons singletonS #.Nil) (generate singletonS) _ - (do ////.monad + (do phase.monad [membersI (|> membersS list.enumerate (monad.map @ (function (_ [idx member]) @@ -57,7 +58,7 @@ (def: #export (variant generate [lefts right? valueS]) (Generator (Variant Synthesis)) - (do ////.monad + (do phase.monad [valueI (generate valueS)] (wrap (do _.monad [_ (_.int (.i64 (if right? diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/type.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/type.lux index 954740d2d..954740d2d 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/type.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/type.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux index 462c625c9..462c625c9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/value.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux index 6d3500416..6d3500416 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/case.lux index c74ceb8c7..c74ceb8c7 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension/common.lux index 5b57e7538..5b57e7538 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/function.lux index 7bac2e107..7bac2e107 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux index f1bb7fb84..f1bb7fb84 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/primitive.lux index 4e326d1a3..4e326d1a3 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/reference.lux index ad8e4c6a0..ad8e4c6a0 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux index 47e58fc57..47e58fc57 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux index d7c26c8a0..d7c26c8a0 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php.lux index 6d3500416..6d3500416 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux index cbdbb1c70..cbdbb1c70 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension/common.lux index 07f76e258..07f76e258 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux index 6e75f37bc..6e75f37bc 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux index 3ec2d2d40..3ec2d2d40 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux index b5b953ba7..b5b953ba7 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/reference.lux index 77b9bec74..77b9bec74 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux index 3adf01716..3adf01716 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/structure.lux index 8ea387fa2..8ea387fa2 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/php/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python.lux index c0cd734b3..c0cd734b3 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux index aeaa18986..aeaa18986 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension/common.lux index b9fd166cc..b9fd166cc 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux index ed6e53274..ed6e53274 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux index 02d4a92ec..02d4a92ec 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/primitive.lux index da651ad8b..da651ad8b 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/reference.lux index c3daa9d37..c3daa9d37 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index 5524980f6..5524980f6 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux index 954efde26..954efde26 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/python/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux index 8a80953e9..8a80953e9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby.lux index a83ac89e1..a83ac89e1 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux index 8d95783a9..8d95783a9 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension/common.lux index 0ebfe1ab5..0ebfe1ab5 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux index 02e221894..02e221894 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux index 4bb7d44c7..4bb7d44c7 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/primitive.lux index b437230ee..b437230ee 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/reference.lux index 3a8e7e635..3a8e7e635 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux index a4062693c..a4062693c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux index a929f736c..a929f736c 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme.lux index 0152ffbcd..0152ffbcd 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux index 861032fc7..861032fc7 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension.lux index 3bc0a0887..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux index 19776e6f5..19776e6f5 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/common.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux index 797e31e1d..797e31e1d 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux index 294b3ed2d..294b3ed2d 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/primitive.lux index 4bfa67161..4bfa67161 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/primitive.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/primitive.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/reference.lux index b9add2e48..b9add2e48 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/reference.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/reference.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux index 992701393..992701393 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/runtime.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux index f435442cc..f435442cc 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/structure.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux diff --git a/stdlib/source/lux/tool/compiler/phase/synthesis.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis.lux index 45372e46b..83402a0d4 100644 --- a/stdlib/source/lux/tool/compiler/phase/synthesis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis.lux @@ -8,17 +8,19 @@ [data ["." maybe] [collection - ["." list ("#;." functor)] + ["." list ("#@." functor)] ["." dictionary (#+ Dictionary)]]]] ["." / #_ ["#." function] ["#." case] - ["#/" // ("#;." monad) + ["/#" // #_ ["#." extension] - ["#/" // #_ - [reference (#+)] + ["/#" // #_ ["#." analysis (#+ Analysis)] - ["/" synthesis (#+ Synthesis Phase)]]]]) + ["/" synthesis (#+ Synthesis Phase)] + [/// + [reference (#+)] + ["." phase ("#@." monad)]]]]]) (def: (primitive analysis) (-> ///analysis.Primitive /.Primitive) @@ -44,22 +46,22 @@ Phase (case analysis (#///analysis.Primitive analysis') - (//;wrap (#/.Primitive (..primitive analysis'))) + (phase@wrap (#/.Primitive (..primitive analysis'))) (#///analysis.Structure structure) (case structure (#///analysis.Variant variant) - (do //.monad + (do phase.monad [valueS (phase (get@ #///analysis.value variant))] (wrap (/.variant (set@ #///analysis.value valueS variant)))) (#///analysis.Tuple tuple) (|> tuple - (monad.map //.monad phase) - (//;map (|>> /.tuple)))) + (monad.map phase.monad phase) + (phase@map (|>> /.tuple)))) (#///analysis.Reference reference) - (//;wrap (#/.Reference reference)) + (phase@wrap (#/.Reference reference)) (#///analysis.Case inputA branchesAB+) (/case.synthesize phase inputA branchesAB+) @@ -76,13 +78,13 @@ (#///analysis.Extension name args) (function (_ state) (|> (//extension.apply phase [name args]) - (//.run' state) + (phase.run' state) (case> (#try.Success output) (#try.Success output) (#try.Failure _) - (<| (//.run' state) - (do //.monad + (<| (phase.run' state) + (do phase.monad [argsS+ (monad.map @ phase args)] (wrap (#/.Extension [name argsS+]))))))) )) diff --git a/stdlib/source/lux/tool/compiler/phase/synthesis/case.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 55cdf5034..e02f5d3b6 100644 --- a/stdlib/source/lux/tool/compiler/phase/synthesis/case.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -15,11 +15,13 @@ [collection ["." list ("#@." functor fold monoid)] ["." set (#+ Set)]]]] - ["." /// ("#@." monad) - ["#/" // - ["#." reference (#+ Variable)] + ["." /// #_ + [// ["#." analysis (#+ Pattern Match Analysis)] - ["/" synthesis (#+ Path Synthesis Operation Phase)]]]) + ["/" synthesis (#+ Path Synthesis Operation Phase)] + [/// + ["#." reference (#+ Variable)] + ["#" phase ("#@." monad)]]]]) (def: clean-up (-> Path Path) @@ -28,28 +30,28 @@ (def: (path' pattern end? thenC) (-> Pattern Bit (Operation Path) (Operation Path)) (case pattern - (#////analysis.Simple simple) + (#///analysis.Simple simple) (case simple - #////analysis.Unit + #///analysis.Unit thenC (^template [<from> <to>] (<from> value) (///@map (|>> (#/.Seq (#/.Test (|> value <to>)))) thenC)) - ([#////analysis.Bit #/.Bit] - [#////analysis.Nat (<| #/.I64 .i64)] - [#////analysis.Int (<| #/.I64 .i64)] - [#////analysis.Rev (<| #/.I64 .i64)] - [#////analysis.Frac #/.F64] - [#////analysis.Text #/.Text])) - - (#////analysis.Bind register) + ([#///analysis.Bit #/.Bit] + [#///analysis.Nat (<| #/.I64 .i64)] + [#///analysis.Int (<| #/.I64 .i64)] + [#///analysis.Rev (<| #/.I64 .i64)] + [#///analysis.Frac #/.F64] + [#///analysis.Text #/.Text])) + + (#///analysis.Bind register) (<| (:: ///.monad map (|>> (#/.Seq (#/.Bind register)))) /.with-new-local thenC) - (#////analysis.Complex (#////analysis.Variant [lefts right? value-pattern])) + (#///analysis.Complex (#///analysis.Variant [lefts right? value-pattern])) (<| (///@map (|>> (#/.Seq (#/.Access (#/.Side (if right? (#.Right lefts) (#.Left lefts))))))) @@ -57,7 +59,7 @@ (when> [(new> (not end?) [])] [(///@map ..clean-up)]) thenC) - (#////analysis.Complex (#////analysis.Tuple tuple)) + (#///analysis.Complex (#///analysis.Tuple tuple)) (let [tuple::last (dec (list.size tuple))] (list@fold (function (_ [tuple::lefts tuple::member] nextC) (let [right? (n.= tuple::last tuple::lefts) @@ -127,12 +129,12 @@ (do ///.monad [inputS (synthesize^ inputA)] (with-expansions [<unnecesary-let> - (as-is (^multi (^ (#////analysis.Reference (////reference.local outputR))) + (as-is (^multi (^ (#///analysis.Reference (///reference.local outputR))) (n.= inputR outputR)) (wrap inputS)) <let> - (as-is [[(#////analysis.Bind inputR) headB/bodyA] + (as-is [[(#///analysis.Bind inputR) headB/bodyA] #.Nil] (case headB/bodyA <unnecesary-let> @@ -144,10 +146,10 @@ (wrap (/.branch/let [inputS inputR headB/bodyS]))))) <if> - (as-is (^or (^ [[(////analysis.pattern/bit #1) thenA] - (list [(////analysis.pattern/bit #0) elseA])]) - (^ [[(////analysis.pattern/bit #0) elseA] - (list [(////analysis.pattern/bit #1) thenA])])) + (as-is (^or (^ [[(///analysis.pattern/bit #1) thenA] + (list [(///analysis.pattern/bit #0) elseA])]) + (^ [[(///analysis.pattern/bit #0) elseA] + (list [(///analysis.pattern/bit #1) thenA])])) (do @ [thenS (synthesize^ thenA) elseS (synthesize^ elseA)] @@ -190,8 +192,8 @@ (def: empty Storage - {#bindings (set.new ////reference.hash) - #dependencies (set.new ////reference.hash)}) + {#bindings (set.new ///reference.hash) + #dependencies (set.new ///reference.hash)}) ## TODO: Use this to declare all local variables at the beginning of ## script functions. @@ -206,7 +208,7 @@ path-storage ..empty] (case path (^ (/.path/bind register)) - (update@ #bindings (set.add (#////reference.Local register)) + (update@ #bindings (set.add (#///reference.Local register)) path-storage) (^or (^ (/.path/seq left right)) @@ -224,7 +226,7 @@ (^ (/.tuple members)) (list@fold for-synthesis synthesis-storage members) - (#/.Reference (#////reference.Variable var)) + (#/.Reference (#///reference.Variable var)) (if (set.member? (get@ #bindings synthesis-storage) var) synthesis-storage (update@ #dependencies (set.add var) synthesis-storage)) @@ -234,14 +236,14 @@ (^ (/.function/abstraction [environment arity bodyS])) (list@fold (function (_ variable storage) - (for-synthesis (#/.Reference (#////reference.Variable variable)) + (for-synthesis (#/.Reference (#///reference.Variable variable)) storage)) synthesis-storage environment) (^ (/.branch/let [inputS register exprS])) (list@fold for-synthesis - (update@ #bindings (set.add (#////reference.Local register)) + (update@ #bindings (set.add (#///reference.Local register)) synthesis-storage) (list inputS exprS)) diff --git a/stdlib/source/lux/tool/compiler/phase/synthesis/function.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/function.lux index 4e09f08e9..91cea2d9d 100644 --- a/stdlib/source/lux/tool/compiler/phase/synthesis/function.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -9,28 +9,29 @@ ["." text ["%" format (#+ format)]] [collection - ["." list ("#;." functor monoid fold)] + ["." list ("#@." functor monoid fold)] ["dict" dictionary (#+ Dictionary)]]]] ["." // #_ ["#." loop (#+ Transform)] - ["#/" // ("#;." monad) - ["#/" // #_ + ["//#" /// #_ + ["#." analysis (#+ Environment Analysis)] + ["/" synthesis (#+ Path Synthesis Operation Phase)] + [/// [arity (#+ Arity)] ["#." reference (#+ Register Variable)] - ["#." analysis (#+ Environment Analysis)] - ["/" synthesis (#+ Path Synthesis Operation Phase)]]]]) + ["." phase ("#@." monad)]]]]) (exception: #export (cannot-find-foreign-variable-in-environment {foreign Register} {environment Environment}) (ex.report ["Foreign" (%.nat foreign)] ["Environment" (|> environment - (list;map ////reference.%variable) + (list@map ////reference.%variable) (text.join-with " "))])) (def: arity-arguments (-> Arity (List Synthesis)) (|>> dec (list.n/range 1) - (list;map (|>> /.variable/local)))) + (list@map (|>> /.variable/local)))) (template: #export (self-reference) (/.variable/local 0)) @@ -43,7 +44,7 @@ (-> Phase Phase) (function (_ exprA) (let [[funcA argsA] (////analysis.application exprA)] - (do ///.monad + (do phase.monad [funcS (phase funcA) argsS (monad.map @ phase argsA) ## locals /.locals @@ -56,7 +57,7 @@ ## (maybe.default <apply>))) (^ (/.function/apply [funcS' argsS'])) - (wrap (/.function/apply [funcS' (list;compose argsS' argsS)])) + (wrap (/.function/apply [funcS' (list@compose argsS' argsS)])) _ (wrap <apply>))))))) @@ -65,20 +66,20 @@ (-> Environment Register (Operation Variable)) (case (list.nth register environment) (#.Some aliased) - (///;wrap aliased) + (phase@wrap aliased) #.None - (///.throw cannot-find-foreign-variable-in-environment [register environment]))) + (phase.throw cannot-find-foreign-variable-in-environment [register environment]))) (def: (grow-path grow path) (-> (-> Synthesis (Operation Synthesis)) Path (Operation Path)) (case path (#/.Bind register) - (///;wrap (#/.Bind (inc register))) + (phase@wrap (#/.Bind (inc register))) (^template [<tag>] (<tag> left right) - (do ///.monad + (do phase.monad [left' (grow-path grow left) right' (grow-path grow right)] (wrap (<tag> left' right')))) @@ -87,18 +88,18 @@ (#/.Then thenS) (|> thenS grow - (///;map (|>> #/.Then))) + (phase@map (|>> #/.Then))) _ - (///;wrap path))) + (phase@wrap path))) (def: (grow-sub-environment super sub) (-> Environment Environment (Operation Environment)) - (monad.map ///.monad + (monad.map phase.monad (function (_ variable) (case variable (#////reference.Local register) - (///;wrap (#////reference.Local (inc register))) + (phase@wrap (#////reference.Local (inc register))) (#////reference.Foreign register) (find-foreign super register))) @@ -112,50 +113,50 @@ (#////analysis.Variant [lefts right? subS]) (|> subS (grow environment) - (///;map (|>> [lefts right?] /.variant))) + (phase@map (|>> [lefts right?] /.variant))) (#////analysis.Tuple membersS+) (|> membersS+ - (monad.map ///.monad (grow environment)) - (///;map (|>> /.tuple)))) + (monad.map phase.monad (grow environment)) + (phase@map (|>> /.tuple)))) (^ (..self-reference)) - (///;wrap (/.function/apply [expression (list (/.variable/local 1))])) + (phase@wrap (/.function/apply [expression (list (/.variable/local 1))])) (#/.Reference reference) (case reference (#////reference.Variable variable) (case variable (#////reference.Local register) - (///;wrap (/.variable/local (inc register))) + (phase@wrap (/.variable/local (inc register))) (#////reference.Foreign register) (|> register (find-foreign environment) - (///;map (|>> /.variable)))) + (phase@map (|>> /.variable)))) (#////reference.Constant constant) - (///;wrap expression)) + (phase@wrap expression)) (#/.Control control) (case control (#/.Branch branch) (case branch (#/.Let [inputS register bodyS]) - (do ///.monad + (do phase.monad [inputS' (grow environment inputS) bodyS' (grow environment bodyS)] (wrap (/.branch/let [inputS' (inc register) bodyS']))) (#/.If [testS thenS elseS]) - (do ///.monad + (do phase.monad [testS' (grow environment testS) thenS' (grow environment thenS) elseS' (grow environment elseS)] (wrap (/.branch/if [testS' thenS' elseS']))) (#/.Case [inputS pathS]) - (do ///.monad + (do phase.monad [inputS' (grow environment inputS) pathS' (grow-path (grow environment) pathS)] (wrap (/.branch/case [inputS' pathS'])))) @@ -163,46 +164,46 @@ (#/.Loop loop) (case loop (#/.Scope [start initsS+ iterationS]) - (do ///.monad + (do phase.monad [initsS+' (monad.map @ (grow environment) initsS+) iterationS' (grow environment iterationS)] (wrap (/.loop/scope [start initsS+' iterationS']))) (#/.Recur argumentsS+) (|> argumentsS+ - (monad.map ///.monad (grow environment)) - (///;map (|>> /.loop/recur)))) + (monad.map phase.monad (grow environment)) + (phase@map (|>> /.loop/recur)))) (#/.Function function) (case function (#/.Abstraction [_env _arity _body]) - (do ///.monad + (do phase.monad [_env' (grow-sub-environment environment _env)] (wrap (/.function/abstraction [_env' _arity _body]))) (#/.Apply funcS argsS+) (case funcS (^ (/.function/apply [(..self-reference) pre-argsS+])) - (///;wrap (/.function/apply [(..self-reference) - (list;compose pre-argsS+ argsS+)])) + (phase@wrap (/.function/apply [(..self-reference) + (list@compose pre-argsS+ argsS+)])) _ - (do ///.monad + (do phase.monad [funcS' (grow environment funcS) argsS+' (monad.map @ (grow environment) argsS+)] (wrap (/.function/apply [funcS' argsS+'])))))) (#/.Extension name argumentsS+) (|> argumentsS+ - (monad.map ///.monad (grow environment)) - (///;map (|>> (#/.Extension name)))) + (monad.map phase.monad (grow environment)) + (phase@map (|>> (#/.Extension name)))) _ - (///;wrap expression))) + (phase@wrap expression))) (def: #export (abstraction phase environment bodyA) (-> Phase Environment Analysis (Operation Synthesis)) - (do ///.monad + (do phase.monad [bodyS (phase bodyA)] (case bodyS (^ (/.function/abstraction [env' down-arity' bodyS'])) diff --git a/stdlib/source/lux/tool/compiler/phase/synthesis/loop.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/loop.lux index 62bfda31c..f4cc28012 100644 --- a/stdlib/source/lux/tool/compiler/phase/synthesis/loop.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/phase/synthesis/loop.lux @@ -16,10 +16,11 @@ ["." /// #_ ## TODO: Remove the 'extension' import ASAP. ["#." extension] - ["#/" // - ["#." reference (#+ Register Variable)] + [// ["#." analysis (#+ Environment)] - ["/" synthesis (#+ Path Abstraction Synthesis)]]]) + ["/" synthesis (#+ Path Abstraction Synthesis)] + [/// + ["#." reference (#+ Register Variable)]]]]) (type: #export (Transform a) (-> a (Maybe a))) @@ -31,7 +32,7 @@ #.None #0)) (template: #export (self) - (#/.Reference (////reference.local 0))) + (#/.Reference (///reference.local 0))) (template: (recursive-apply args) (#/.Apply (self) args)) @@ -47,10 +48,10 @@ (#/.Structure structure) (case structure - (#////analysis.Variant variantS) - (proper? (get@ #////analysis.value variantS)) + (#///analysis.Variant variantS) + (proper? (get@ #///analysis.value variantS)) - (#////analysis.Tuple membersS+) + (#///analysis.Tuple membersS+) (list.every? proper? membersS+)) (#/.Control controlS) @@ -91,7 +92,7 @@ (#/.Function functionS) (case functionS (#/.Abstraction environment arity bodyS) - (list.every? ////reference.self? environment) + (list.every? ///reference.self? environment) (#/.Apply funcS argsS) (and (proper? funcS) @@ -168,7 +169,7 @@ (-> Environment (Transform Variable)) (function (_ variable) (case variable - (#////reference.Foreign register) + (#///reference.Foreign register) (list.nth register environment) _ @@ -201,31 +202,31 @@ (case exprS (#/.Structure structureS) (case structureS - (#////analysis.Variant variantS) + (#///analysis.Variant variantS) (do maybe.monad - [valueS' (|> variantS (get@ #////analysis.value) recur)] + [valueS' (|> variantS (get@ #///analysis.value) recur)] (wrap (|> variantS - (set@ #////analysis.value valueS') - #////analysis.Variant + (set@ #///analysis.value valueS') + #///analysis.Variant #/.Structure))) - (#////analysis.Tuple membersS+) + (#///analysis.Tuple membersS+) (|> membersS+ (monad.map maybe.monad recur) - (maybe;map (|>> #////analysis.Tuple #/.Structure)))) + (maybe;map (|>> #///analysis.Tuple #/.Structure)))) (#/.Reference reference) (case reference - (^ (////reference.constant constant)) + (^ (///reference.constant constant)) (#.Some exprS) - (^ (////reference.local register)) - (#.Some (#/.Reference (////reference.local (n.+ offset register)))) + (^ (///reference.local register)) + (#.Some (#/.Reference (///reference.local (n.+ offset register)))) - (^ (////reference.foreign register)) + (^ (///reference.foreign register)) (|> scope-environment (list.nth register) - (maybe;map (|>> #////reference.Variable #/.Reference)))) + (maybe;map (|>> #///reference.Variable #/.Reference)))) (^ (/.branch/case [inputS pathS])) (do maybe.monad diff --git a/stdlib/source/lux/tool/compiler/synthesis.lux b/stdlib/source/lux/tool/compiler/language/lux/synthesis.lux index 3d1f7c6e3..7519df0a2 100644 --- a/stdlib/source/lux/tool/compiler/synthesis.lux +++ b/stdlib/source/lux/tool/compiler/language/lux/synthesis.lux @@ -17,11 +17,13 @@ ["." list ("#;." functor)] ["." dictionary (#+ Dictionary)]]]] ["." // #_ - [arity (#+ Arity)] - ["#." reference (#+ Register Variable Reference)] ["#." analysis (#+ Environment Composite Analysis)] - ["#." phase - ["." extension (#+ Extension)]]]) + [phase + ["." extension (#+ Extension)]] + [/// + [arity (#+ Arity)] + ["#." reference (#+ Register Variable Reference)] + ["#." phase]]]) (type: #export Resolver (Dictionary Variable Variable)) diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 4faa66057..7bcc07d7c 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -28,17 +28,18 @@ ["." console]] [tool [compiler - ["." analysis - [macro (#+ Expander)]] - ["." generation] - ["." directive] - ["." phase - [extension (#+ Extender)]] + ["." phase] [default ["." platform (#+ Platform)]] [language [lux - ["." syntax]]] + ["." syntax] + ["." analysis + [macro (#+ Expander)]] + ["." generation] + ["." directive] + [phase + [extension (#+ Extender)]]]] [meta ["." archive (#+ Archive)]]] ## ["." interpreter] |