summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/GF/Compile/Compute/Predef.hs3
-rw-r--r--src/compiler/GF/Compile/Compute/Value.hs2
-rw-r--r--src/compiler/GF/Compile/GeneratePMCFG.hs2
-rw-r--r--src/compiler/GF/Compile/PGFtoJS.hs1
-rw-r--r--src/compiler/GF/Compile/PGFtoPython.hs1
-rw-r--r--src/compiler/GF/Compile/TypeCheck/Primitives.hs2
-rw-r--r--src/compiler/GF/Grammar/Predef.hs1
-rw-r--r--src/compiler/GF/Speech/PGFToCFG.hs1
8 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/Compute/Predef.hs b/src/compiler/GF/Compile/Compute/Predef.hs
index b9bb01ce8..74697a89b 100644
--- a/src/compiler/GF/Compile/Compute/Predef.hs
+++ b/src/compiler/GF/Compile/Compute/Predef.hs
@@ -79,7 +79,7 @@ predefList =
-- Canonical values:
(cPBool,PBool),(cPFalse,PFalse),(cPTrue,PTrue),(cInt,Int),
(cInts,Ints),(cNonExist,NonExist)
- ,(cBIND,BIND),(cSOFT_BIND,SOFT_BIND)]
+ ,(cBIND,BIND),(cSOFT_BIND,SOFT_BIND),(cCAPIT,CAPIT)]
--- add more functions!!!
delta f vs =
@@ -109,6 +109,7 @@ delta f vs =
NonExist-> canonical
BIND -> canonical
SOFT_BIND->canonical
+ CAPIT -> canonical
where
canonical = delay
delay = return (VApp f vs) -- wrong number of arguments
diff --git a/src/compiler/GF/Compile/Compute/Value.hs b/src/compiler/GF/Compile/Compute/Value.hs
index 64683a3de..f076e47ba 100644
--- a/src/compiler/GF/Compile/Compute/Value.hs
+++ b/src/compiler/GF/Compile/Compute/Value.hs
@@ -52,5 +52,5 @@ data Predefined = Drop | Take | Tk | Dp | EqStr | Occur | Occurs | ToUpper
| Error
-- Canonical values below:
| PBool | PFalse | PTrue | Int | Ints | NonExist
- | BIND | SOFT_BIND
+ | BIND | SOFT_BIND | CAPIT
deriving (Show,Eq,Ord,Ix,Bounded,Enum)
diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs
index aa22ea412..40872170c 100644
--- a/src/compiler/GF/Compile/GeneratePMCFG.hs
+++ b/src/compiler/GF/Compile/GeneratePMCFG.hs
@@ -443,6 +443,8 @@ convertTerm opts sel ctype (Q (m,f))
f == cBIND = return (CStr [SymBIND])
| m == cPredef &&
f == cSOFT_BIND = return (CStr [SymSOFT_BIND])
+ | m == cPredef &&
+ f == cCAPIT = return (CStr [SymCAPIT])
convertTerm opts sel@(CProj l _) ctype (ExtR t1 t2@(R rs2))
| l `elem` map fst rs2 = convertTerm opts sel ctype t2
diff --git a/src/compiler/GF/Compile/PGFtoJS.hs b/src/compiler/GF/Compile/PGFtoJS.hs
index 1a3d81a89..6c391f717 100644
--- a/src/compiler/GF/Compile/PGFtoJS.hs
+++ b/src/compiler/GF/Compile/PGFtoJS.hs
@@ -89,6 +89,7 @@ sym2js (SymKP ts alts) = new "SymKP" [JS.EArray (map sym2js ts), JS.EArray (map
sym2js SymNE = new "SymNE" []
sym2js SymBIND = new "SymKS" [JS.EStr "&+"]
sym2js SymSOFT_BIND = new "SymKS" [JS.EStr "&+"]
+sym2js SymCAPIT = new "SymKS" [JS.EStr "&|"]
alt2js (ps,ts) = new "Alt" [JS.EArray (map sym2js ps), JS.EArray (map JS.EStr ts)]
diff --git a/src/compiler/GF/Compile/PGFtoPython.hs b/src/compiler/GF/Compile/PGFtoPython.hs
index 72b4f1ff8..01b6437ac 100644
--- a/src/compiler/GF/Compile/PGFtoPython.hs
+++ b/src/compiler/GF/Compile/PGFtoPython.hs
@@ -79,6 +79,7 @@ pySymbol (SymKP ts alts) = pyDict 0 pyStr id [("pre", pyList 0 pySymbol ts), ("a
where alt2py (ps,ts) = pyTuple 0 (pyList 0 pyStr) [map pySymbol ps, ts]
pySymbol SymBIND = pyStr "&+"
pySymbol SymSOFT_BIND = pyStr "&+"
+pySymbol SymCAPIT = pyStr "&|"
pySymbol SymNE = pyDict 0 pyStr id [("nonExist", pyTuple 0 id [])]
----------------------------------------------------------------------
diff --git a/src/compiler/GF/Compile/TypeCheck/Primitives.hs b/src/compiler/GF/Compile/TypeCheck/Primitives.hs
index bf3d92b24..a318e74b0 100644
--- a/src/compiler/GF/Compile/TypeCheck/Primitives.hs
+++ b/src/compiler/GF/Compile/TypeCheck/Primitives.hs
@@ -53,6 +53,8 @@ primitives = Map.fromList
[] typeStr []))) Nothing)
, (cSOFT_BIND, ResOper (Just (noLoc (mkProd -- Str
[] typeStr []))) Nothing)
+ , (cCAPIT , ResOper (Just (noLoc (mkProd -- Str
+ [] typeStr []))) Nothing)
]
where
fun from to = oper (mkFunType from to)
diff --git a/src/compiler/GF/Grammar/Predef.hs b/src/compiler/GF/Grammar/Predef.hs
index 8ffd17b74..633ced494 100644
--- a/src/compiler/GF/Grammar/Predef.hs
+++ b/src/compiler/GF/Grammar/Predef.hs
@@ -32,6 +32,7 @@ cUndefinedType = identS "UndefinedType"
cNonExist = identS "nonExist"
cBIND = identS "BIND"
cSOFT_BIND = identS "SOFT_BIND"
+cCAPIT = identS "CAPIT"
isPredefCat :: Ident -> Bool
isPredefCat c = elem c [cInt,cString,cFloat]
diff --git a/src/compiler/GF/Speech/PGFToCFG.hs b/src/compiler/GF/Speech/PGFToCFG.hs
index 49744f22e..e5090fa0f 100644
--- a/src/compiler/GF/Speech/PGFToCFG.hs
+++ b/src/compiler/GF/Speech/PGFToCFG.hs
@@ -97,6 +97,7 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co
---- AR 3/6/2010
symbolToCFSymbol SymBIND = [Terminal "&+"]
symbolToCFSymbol SymSOFT_BIND = []
+ symbolToCFSymbol SymCAPIT = [Terminal "&|"]
symbolToCFSymbol SymNE = []
fixProfile :: Array DotPos Symbol -> Int -> Profile