1
0
forked from GitHub/gf-core

add commands to add/remove concrete syntaxes

This commit is contained in:
krangelov
2021-12-24 13:56:27 +01:00
parent 67a7e928f6
commit cb10e2fe32
4 changed files with 21 additions and 6 deletions

View File

@@ -242,6 +242,9 @@ transactionCommand (CreateCat opts c ctxt) pgf = do
Left msg -> putStrLnE msg
Right ty -> do lift $ modifyPGF pgf (createCategory c ctxt prob)
return ()
transactionCommand (CreateConcrete opts name) pgf = do
lift $ modifyPGF pgf (createConcrete name (return ()))
return ()
transactionCommand (CreateLin opts f t) pgf = do
lang <- optLang pgf opts
lift $ modifyPGF pgf (alterConcrete lang (createLin f []))
@@ -256,6 +259,9 @@ transactionCommand (DropFun opts f) pgf = do
transactionCommand (DropCat opts c) pgf = do
lift $ modifyPGF pgf (dropCategory c)
return ()
transactionCommand (DropConcrete opts name) pgf = do
lift $ modifyPGF pgf (dropConcrete name)
return ()
transactionCommand (DropLin opts f) pgf = do
lang <- optLang pgf opts
lift $ modifyPGF pgf (alterConcrete lang (dropLin f))