mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 10:19:32 -06:00
gfse: text mode editing: accept grammars with printname judgements
But printname judgements are ignored for now. Also fixed an UTF-8 encoding bug when parsing uploaded grammars in gf -server mode.
This commit is contained in:
@@ -103,7 +103,7 @@ convOpen o =
|
||||
_ -> fail "unsupported module open"
|
||||
|
||||
|
||||
data CncJment = Pa S.Param | LC Lincat | Op Oper | Li Lin
|
||||
data CncJment = Pa S.Param | LC Lincat | Op Oper | Li Lin | Ignored
|
||||
|
||||
convCncJments = mapM convCncJment . Map.toList
|
||||
|
||||
@@ -111,13 +111,14 @@ convCncJment (name,jment) =
|
||||
case jment of
|
||||
ResParam ops _ ->
|
||||
return $ Pa $ Param i (maybe "" (render . ppParams q . unLoc) ops)
|
||||
CncCat (Just (L _ typ)) Nothing Nothing _ ->
|
||||
ResValue _ -> return Ignored
|
||||
CncCat (Just (L _ typ)) Nothing pprn _ -> -- ignores printname !!
|
||||
return $ LC $ Lincat i (render $ ppTerm q 0 typ)
|
||||
ResOper oltyp (Just lterm) -> return $ Op $ Oper lhs rhs
|
||||
where
|
||||
lhs = i++maybe "" ((" : "++) . render . ppTerm q 0 . unLoc) oltyp
|
||||
rhs = " = "++render (ppTerm q 0 (unLoc lterm))
|
||||
CncFun _ (Just ldef) Nothing _ ->
|
||||
CncFun _ (Just ldef) pprn _ -> -- ignores printname !!
|
||||
do let (xs,e') = getAbs (unLoc ldef)
|
||||
lin = render $ ppTerm q 0 e'
|
||||
args <- mapM convBind xs
|
||||
|
||||
Reference in New Issue
Block a user