mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 01:52:50 -06:00
Add support for SOFT_BIND (which PGF runtime doesn't support)
This commit is contained in:
@@ -92,7 +92,7 @@ mkCanon2lpgf opts gr am = do
|
|||||||
|
|
||||||
C.PredefValue (C.PredefId pid) -> case pid of
|
C.PredefValue (C.PredefId pid) -> case pid of
|
||||||
"BIND" -> return L.LFBind
|
"BIND" -> return L.LFBind
|
||||||
-- "SOFT_BIND" ->
|
"SOFT_BIND" -> return L.LFBind
|
||||||
-- "SOFT_SPACE" ->
|
-- "SOFT_SPACE" ->
|
||||||
-- "CAPIT" ->
|
-- "CAPIT" ->
|
||||||
-- "ALL_CAPIT" ->
|
-- "ALL_CAPIT" ->
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
abstract Bind = {
|
abstract Bind = {
|
||||||
cat S ; F ;
|
cat S ;
|
||||||
fun
|
fun
|
||||||
FtoS : F -> S ;
|
f1 : S ;
|
||||||
f1 : F ;
|
f2 : S ;
|
||||||
f2 : F ;
|
concat : S -> S -> S ;
|
||||||
|
bind : S -> S -> S ;
|
||||||
|
softbind : S -> S -> S ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
Bind: FtoS f1
|
Bind: f1
|
||||||
BindCnc: hello there
|
BindCnc: hello there
|
||||||
|
|
||||||
Bind: FtoS f2
|
Bind: f2
|
||||||
BindCnc: goodbye
|
BindCnc: goodbye
|
||||||
|
|
||||||
|
Bind: concat f1 f2
|
||||||
|
BindCnc: hello there goodbye
|
||||||
|
|
||||||
|
Bind: bind f1 f2
|
||||||
|
BindCnc: hello theregoodbye
|
||||||
|
|
||||||
|
Bind: softbind f1 f2
|
||||||
|
BindCnc: hello theregoodbye
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
FtoS f1
|
f1
|
||||||
FtoS f2
|
f2
|
||||||
|
concat f1 f2
|
||||||
|
bind f1 f2
|
||||||
|
softbind f1 f2
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
concrete BindCnc of Bind = open Prelude in {
|
concrete BindCnc of Bind = open Prelude in {
|
||||||
lincat
|
lincat
|
||||||
S = Str ;
|
S = SS ;
|
||||||
F = { s : Str } ;
|
|
||||||
lin
|
lin
|
||||||
f1 = { s = "hello the" ++ BIND ++ "re" } ;
|
f1 = ss ("hello the" ++ BIND ++ "re") ;
|
||||||
f2 = { s = "good" ++ "bye" } ;
|
f2 = ss ("good" ++ SOFT_BIND ++ "bye") ;
|
||||||
FtoS f = f.s ;
|
concat a b = ss (a.s ++ b.s) ;
|
||||||
|
bind a b = ss (a.s ++ BIND ++ b.s) ;
|
||||||
|
softbind a b = ss (a.s ++ SOFT_BIND ++ b.s) ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user