summaryrefslogtreecommitdiff
path: root/src/www/gfse/gf_abs.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/www/gfse/gf_abs.js')
-rw-r--r--src/www/gfse/gf_abs.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/www/gfse/gf_abs.js b/src/www/gfse/gf_abs.js
index 30f852196..caa83fa90 100644
--- a/src/www/gfse/gf_abs.js
+++ b/src/www/gfse/gf_abs.js
@@ -20,9 +20,9 @@ type Concrete = { langcode: Id,
params: [{name: Id, rhs: String}],
lincats : [{ cat: Cat, type: Term}],
opers: [{name: Lhs, rhs: Term}],
- lins: [{fun: FunId, args: [Id], lin: Term}]
+ lins: [Lin]
}
-
+type Lin = {fun: FunId, args: [Id], lin: Term}
type Lhs = String -- name and type of oper,
-- e.g "regN : Str -> { s:Str,g:Gender} ="
@@ -85,6 +85,13 @@ function cat_lincat(conc,cat) {
return null;
}
+// Return the lin defined in a given concrete syntax for an abstract function
+// cat_lincat :: Concrete -> FunId -> Lin
+function fun_lin(conc,fun) {
+ with(conc) for(var i in lins) if(lins[i].fun==fun) return lins[i]
+ return null;
+}
+
// Return the index of the concrete syntax with a given langcode
// conc_index :: Grammar -> Id -> Int
function conc_index(g,langcode) {