diff options
| author | hallgren <hallgren@chalmers.se> | 2017-02-21 13:21:59 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2017-02-21 13:21:59 +0000 |
| commit | ae512e09e0ea8e260145be3c74c40853dfc71219 (patch) | |
| tree | 1e91c497a6d7ae9494f86f99db5d4d32a3f28ea0 /src | |
| parent | 94f41cc63dfc0a55d8957762500eb93f2331e1da (diff) | |
Fix compilation errors caused by changes in PGF2
These prevented GF from being built with C run-time support (-fc-runtime).
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/GF/Command/Commands2.hs | 8 | ||||
| -rw-r--r-- | src/server/PGFService.hs | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/GF/Command/Commands2.hs b/src/compiler/GF/Command/Commands2.hs index 4e68c05ff..4ffa4e763 100644 --- a/src/compiler/GF/Command/Commands2.hs +++ b/src/compiler/GF/Command/Commands2.hs @@ -812,7 +812,8 @@ pgfCommands = Map.fromList [ unlines [showFun' f ty|f<-funs, let ty=C.functionType pgf f, target ty == c] - target (C.DTyp _ c _) = c + --target (C.DTyp _ c _) = c + target t = case C.unType t of (_,c,_) -> c {- [e] -> case H.inferExpr pgf e of Left tcErr -> error $ render (H.ppTcError tcErr) @@ -977,7 +978,8 @@ pgfCommands = Map.fromList [ -} optCat pgf opts = case listFlags "cat" opts of - v:_ -> C.DTyp [] (valueString v) [] + --v:_ -> C.DTyp [] (valueString v) [] + v:_ -> C.mkType [] (valueString v) [] _ -> C.startCat pgf {- @@ -1029,7 +1031,7 @@ pgfCommands = Map.fromList [ | otherwise = return void -- TODO implement more options showFun pgf f = showFun' f (C.functionType pgf f) - showFun' f ty = "fun "++f++" : "++C.showType ty + showFun' f ty = "fun "++f++" : "++C.showType [] ty {- prGrammar env@(pgf,mos) opts diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs index 4647c4eb4..d84f2b3c2 100644 --- a/src/server/PGFService.hs +++ b/src/server/PGFService.hs @@ -167,7 +167,7 @@ cpgfMain qsem command (t,(pgf,pc)) = grammar = showJSON $ makeObj ["name".=C.abstractName pgf, "lastmodified".=show t, - "startcat".=C.startCat pgf, + "startcat".=C.showType [] (C.startCat pgf), "languages".=languages] where languages = [makeObj ["name".= l] | (l,_)<-Map.toList langs] @@ -313,7 +313,7 @@ instance JSON C.CId where -} instance JSON C.Expr where readJSON x = readJSON x >>= maybe (fail "Bad expression.") return . C.readExpr - showJSON = showJSON . C.showExpr + showJSON = showJSON . C.showExpr [] -- | Convert a 'Tree' to an 'ATree' |
