From: Mart Lubbers Date: Fri, 22 Apr 2016 11:30:32 +0000 (+0200) Subject: Merge branch 'master' of github.com:dopefishh/cc1516 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=5573b4ce8215a277a82146a8dae4c4e7ef205bd8;p=cc1516.git Merge branch 'master' of github.com:dopefishh/cc1516 --- 5573b4ce8215a277a82146a8dae4c4e7ef205bd8 diff --cc AST.dcl index 463c7b7,e9c6944..f415045 --- a/AST.dcl +++ b/AST.dcl @@@ -1,7 -1,7 +1,7 @@@ definition module AST from Data.Maybe import :: Maybe - from StdOverloaded import class toString, class ==, class zero -from StdOverloaded import class toString, class ==, class < ++from StdOverloaded import class toString, class ==, class zero, class < :: Pos = {line :: Int, col :: Int} :: AST = AST [FunDecl] @@@ -41,5 -41,7 +41,9 @@@ instance toString Pos instance toString Type instance toString AST + +instance zero Pos + instance == Op1 + instance == Op2 + instance < Op1 + instance < Op2 diff --cc AST.icl index 6f2e5c6,26686b2..3679b36 --- a/AST.icl +++ b/AST.icl @@@ -111,5 -115,11 +115,10 @@@ printFunCall s args = [s, "(":printersp derive gEq Op2 instance == Op2 where (==) o1 o2 = gEq{|*|} o1 o2 +instance zero Pos where + zero = {line=0, col=0} ++ + derive gEq Op1 + instance == Op1 where (==) o1 o2 = gEq{|*|} o1 o2 - -instance < Op2 where - (<) o1 o2 = (toString o1) < (toString o2) - -instance < Op1 where - (<) o1 o2 = (toString o1) < (toString o2) ++instance < Op2 where (<) o1 o2 = toString o1 < toString o2 ++instance < Op1 where (<) o1 o2 = toString o1 < toString o2 diff --cc sem.icl index d909508,024d7fe..ef825e4 --- a/sem.icl +++ b/sem.icl @@@ -3,13 -3,12 +3,13 @@@ implementation module se import qualified Data.Map as Map from Data.Func import $ - from StdFunc import o, flip, const -from StdFunc import o, id ++from StdFunc import o, flip, const, id import Control.Monad import Data.Either +import Data.Maybe import Data.Monoid - import Data.List + import Data.List import StdString import StdList