(.module: [lux #* ["." debug] ["@" target ["." jvm] ["." js] ["." python] ["." lua] ["." ruby] ["." php] ["." scheme]] [abstract [monad (#+ do)]] [control ["." try] ["<>" parser ["" code] ["" analysis] ["" synthesis]]] [data ["." text ("#\." equivalence) ["%" format (#+ format)]] [collection ["." row]]] [tool [compiler ["." phase] [language [lux ["." analysis] ["." synthesis] ["." directive] [phase [analysis ["." type]]]]]]] ["_" test (#+ Test)]] {1 ["." / (#+ analysis: synthesis: generation: directive:)]}) (def: my_analysis "my analysis") (def: my_synthesis "my synthesis") (def: my_generation "my generation") (def: my_directive "my directive") ## Generation (for {@.old (as_is)} (as_is (analysis: (..my_generation self phase archive {parameters (<>.some .any)}) (do phase.monad [_ (type.infer .Text)] (wrap (#analysis.Extension self (list))))) (synthesis: (..my_generation self phase archive {parameters (<>.some .any)}) (do phase.monad [] (wrap (#synthesis.Extension self (list))))) )) (for {@.old (as_is)} (generation: (..my_generation self phase archive {parameters (<>.some .any)}) (do phase.monad [] (wrap (for {@.jvm (row.row (#jvm.Constant (#jvm.LDC (#jvm.String self)))) @.js (js.string self) @.python (python.unicode self) @.lua (lua.string self) @.ruby (ruby.string self) @.php (php.string self) @.scheme (scheme.string self)}))))) (for {@.old (as_is)} (as_is (analysis: (..my_analysis self phase archive {parameters (<>.some .any)}) (do phase.monad [_ (type.infer .Text)] (wrap (#analysis.Primitive (#analysis.Text self))))) ## Synthesis (analysis: (..my_synthesis self phase archive {parameters (<>.some .any)}) (do phase.monad [_ (type.infer .Text)] (wrap (#analysis.Extension self (list))))) (synthesis: (..my_synthesis self phase archive {parameters (<>.some .any)}) (do phase.monad [] (wrap (synthesis.text self)))) ## Directive (directive: (..my_directive self phase archive {parameters (<>.some .any)}) (do phase.monad [#let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]] (wrap directive.no_requirements))) (`` ((~~ (static ..my_directive)))) )) (def: #export test Test (<| (_.covering /._) (`` ($_ _.and (~~ (template [ ] [(_.cover [] (for {@.old false} (text\= (`` ((~~ (static )))) )))] [/.analysis: ..my_analysis] [/.synthesis: ..my_synthesis] [/.generation: ..my_generation])) (_.cover [/.directive:] true) ))))