diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2021-06-29 23:48:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-29 23:48:00 +0200 |
| commit | 6efbd23c5cf450f3702e628225872650a619270f (patch) | |
| tree | fbe74bc715730c2932da4e6d7492942beaecd1c0 /src/compiler/SimpleEditor/JSON.hs | |
| parent | 3a27fa0d390b86cab3ecc68418e4116ea5c4f8ba (diff) | |
| parent | 76bec6d71e7c4fdffa2e618ec6578e0858166465 (diff) | |
Merge pull request #84 from ffrixslee/issue-46
Issue 46 (various deprecations during compilation of GF)
Diffstat (limited to 'src/compiler/SimpleEditor/JSON.hs')
| -rw-r--r-- | src/compiler/SimpleEditor/JSON.hs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/compiler/SimpleEditor/JSON.hs b/src/compiler/SimpleEditor/JSON.hs index 8f607dc84..06586c5eb 100644 --- a/src/compiler/SimpleEditor/JSON.hs +++ b/src/compiler/SimpleEditor/JSON.hs @@ -9,14 +9,24 @@ instance JSON Grammar where showJSON (Grammar name extends abstract concretes) = makeObj ["basename".=name, "extends".=extends, "abstract".=abstract, "concretes".=concretes] + readJSON = error "Grammar.readJSON intentionally not defined" instance JSON Abstract where showJSON (Abstract startcat cats funs) = makeObj ["startcat".=startcat, "cats".=cats, "funs".=funs] + readJSON = error "Abstract.readJSON intentionally not defined" -instance JSON Fun where showJSON (Fun name typ) = signature name typ -instance JSON Param where showJSON (Param name rhs) = definition name rhs -instance JSON Oper where showJSON (Oper name rhs) = definition name rhs +instance JSON Fun where + showJSON (Fun name typ) = signature name typ + readJSON = error "Fun.readJSON intentionally not defined" + +instance JSON Param where + showJSON (Param name rhs) = definition name rhs + readJSON = error "Param.readJSON intentionally not defined" + +instance JSON Oper where + showJSON (Oper name rhs) = definition name rhs + readJSON = error "Oper.readJSON intentionally not defined" signature name typ = makeObj ["name".=name,"type".=typ] definition name rhs = makeObj ["name".=name,"rhs".=rhs] @@ -26,12 +36,15 @@ instance JSON Concrete where makeObj ["langcode".=langcode, "opens".=opens, "params".=params, "opers".=opers, "lincats".=lincats, "lins".=lins] + readJSON = error "Concrete.readJSON intentionally not defined" instance JSON Lincat where showJSON (Lincat cat lintype) = makeObj ["cat".=cat, "type".=lintype] + readJSON = error "Lincat.readJSON intentionally not defined" instance JSON Lin where showJSON (Lin fun args lin) = makeObj ["fun".=fun, "args".=args, "lin".=lin] + readJSON = error "Lin.readJSON intentionally not defined" infix 1 .= name .= v = (name,showJSON v) |
