mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 02:38:55 -06:00
Minor renamings in JSON format
This commit is contained in:
@@ -81,16 +81,16 @@ concrete2json (c,cnc) = (showCId c,obj)
|
|||||||
, ("productions", JSON.makeObj [ (show cat, JSArray (map frule2json (Set.toList set))) | (cat,set) <- IntMap.toList (productions cnc)])
|
, ("productions", JSON.makeObj [ (show cat, JSArray (map frule2json (Set.toList set))) | (cat,set) <- IntMap.toList (productions cnc)])
|
||||||
, ("functions", JSArray (map ffun2json (Array.elems (cncfuns cnc))))
|
, ("functions", JSArray (map ffun2json (Array.elems (cncfuns cnc))))
|
||||||
, ("sequences", JSArray (map seq2json (Array.elems (sequences cnc))))
|
, ("sequences", JSArray (map seq2json (Array.elems (sequences cnc))))
|
||||||
, ("startCats", JSON.makeObj $ map cats2json (Map.assocs (cnccats cnc)))
|
, ("categories", JSON.makeObj $ map cats2json (Map.assocs (cnccats cnc)))
|
||||||
, ("totalFIds", mkJSInt (totalCats cnc))
|
, ("totalfids", mkJSInt (totalCats cnc))
|
||||||
]
|
]
|
||||||
|
|
||||||
cats2json :: (CId, CncCat) -> (String,JSValue)
|
cats2json :: (CId, CncCat) -> (String,JSValue)
|
||||||
cats2json (c,CncCat start end _) = (showCId c, ixs)
|
cats2json (c,CncCat start end _) = (showCId c, ixs)
|
||||||
where
|
where
|
||||||
ixs = JSON.makeObj
|
ixs = JSON.makeObj
|
||||||
[ ("s", mkJSInt start)
|
[ ("start", mkJSInt start)
|
||||||
, ("e", mkJSInt end)
|
, ("end", mkJSInt end)
|
||||||
]
|
]
|
||||||
|
|
||||||
frule2json :: Production -> JSValue
|
frule2json :: Production -> JSValue
|
||||||
|
|||||||
@@ -53,8 +53,8 @@
|
|||||||
"productions",
|
"productions",
|
||||||
"functions",
|
"functions",
|
||||||
"sequences",
|
"sequences",
|
||||||
"startCats",
|
"categories",
|
||||||
"totalFIds"
|
"totalfids"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"flags": {
|
"flags": {
|
||||||
@@ -106,26 +106,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"startCats": {
|
"categories": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"title": "CncCat",
|
"title": "CncCat",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"s",
|
"start",
|
||||||
"e"
|
"end"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"s": {
|
"start": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"e": {
|
"end": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"totalFIds": {
|
"totalfids": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user