X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskMakeSymbols.icl;h=f92cb2ae7cbf29045326ee41c1ef511b83ce349b;hb=c6709b5f2b35baa57f11e557d4baa96d6b9a54cf;hp=15b78e4f956f742712743f067bbc0c24421afbac;hpb=fe2e0f56c77de00d25686ab0b583a40595b35ab8;p=mTask.git diff --git a/mTaskMakeSymbols.icl b/mTaskMakeSymbols.icl index 15b78e4..f92cb2a 100644 --- a/mTaskMakeSymbols.icl +++ b/mTaskMakeSymbols.icl @@ -15,11 +15,12 @@ import StdTuple import Data.Tuple import StdList from Data.Func import $ +import Data.List from Text import class Text(join,toUpperCase), instance Text String -derive consIndex BC -derive consName BC -derive gconses BC, AnalogPin +derive consIndex BC, Pin +derive consName BC, Pin +derive conses BC, AnalogPin, DigitalPin, Pin (<+) infixr 5 :: a b -> String | toString a & toString b (<+) a b = toString a +++ toString b @@ -30,7 +31,7 @@ toDefine i b = "#define " <+ toUpperCase (consName{|*|} b) <+ " " <+ i Start w # (io, w) = stdio w # io = io <<< "#ifndef MTASK_H\n#define MTASK_H\n" -# io = io <<< join "\n" (map (uncurry toDefine) (zip2 [1..] conses)) +# io = io <<< join "\n" (zipWith toDefine [0..] conses{|*|}) # (ok, w) = fclose (io <<< "\n#endif\n") w | not ok = abort "Couldn't close stdio" = w