phino 0.0.0.27 → 0.0.0.28
raw patch · 3 files changed
+14/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- phino.cabal +1/−1
- src/Functions.hs +0/−1
- src/XMIR.hs +13/−4
phino.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 name: phino-version: 0.0.0.27+version: 0.0.0.28 license: MIT synopsis: Command-Line Manipulator of 𝜑-Calculus Expressions description: Please see the README on GitHub at <https://github.com/objectionary/phino#readme>
src/Functions.hs view
@@ -11,7 +11,6 @@ import Control.Monad (replicateM) import qualified Data.ByteString.Char8 as B import Data.Char (intToDigit)-import Data.IORef import Data.Set (Set) import qualified Data.Set import GHC.IO (unsafePerformIO)
src/XMIR.hs view
@@ -77,6 +77,15 @@ object :: [(String, String)] -> [Node] -> Node object attrs children = NodeElement (element "o" attrs children) +-- @todo #278:30min Remove xmirAttributure and replace to prettyAttribute. Right now XMIR does not+-- support "ρ" and "φ" in @base and @name attributes. When it's done, we should also generate +-- such valid XMIR. To achieve that we should get rid of xmirAttribute function and use prettyAttribute+-- instead. Also we should use "@" in formationBinding. Don't forget to remove the puzzle. +xmirAttribute :: Attribute -> String+xmirAttribute AtPhi = "@"+xmirAttribute AtRho = "^"+xmirAttribute other = prettyAttribute other+ expression :: Expression -> XmirContext -> IO (String, [Node]) expression ExThis _ = pure ("$", []) expression ExGlobal _ = pure ("Q", [])@@ -85,7 +94,7 @@ pure ("", nested) expression (ExDispatch expr attr) ctx = do (base, children) <- expression expr ctx- let attr' = prettyAttribute attr+ let attr' = xmirAttribute attr if null base then pure ('.' : attr', [object [] children]) else@@ -123,7 +132,7 @@ expression (ExApplication expr (BiTau attr texpr)) ctx = do (base, children) <- expression expr ctx (base', children') <- expression texpr ctx- let as = prettyAttribute attr+ let as = xmirAttribute attr attrs = if null base' then [("as", as)]@@ -144,12 +153,12 @@ pure (Just (object [("name", label), ("base", base)] children)) formationBinding (BiTau AtPhi expr) ctx = do (base, children) <- expression expr ctx- pure (Just (object [("name", "φ"), ("base", base)] children))+ pure (Just (object [("name", "@"), ("base", base)] children)) formationBinding (BiTau AtRho _) _ = pure Nothing formationBinding (BiDelta bytes) _ = pure (Just (NodeContent (T.pack (prettyBytes bytes)))) formationBinding (BiLambda func) _ = pure (Just (object [("name", "λ")] [])) formationBinding (BiVoid AtRho) _ = pure Nothing-formationBinding (BiVoid AtPhi) _ = pure (Just (object [("name", "φ"), ("base", "∅")] []))+formationBinding (BiVoid AtPhi) _ = pure (Just (object [("name", "@"), ("base", "∅")] [])) formationBinding (BiVoid (AtLabel label)) _ = pure (Just (object [("name", label), ("base", "∅")] [])) formationBinding binding _ = throwIO (UnsupportedBinding binding)