Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
abstract UnsupportedTokenGluing = {
flags startcat = S ;
cat
S ; A ;
fun
toS : A -> S ;
a,b : A ;
}
concrete UnsupportedTokenGluingCnc of UnsupportedTokenGluing = open Predef in {
lincat S, A = Str ;
lin
{- Unsupported token gluing:
toS = addA ;
a = "" ;
-}
{-gf: Internal error in GeneratePMCFG:
toS = checkB ;
a = "a" ; b = "b" ;
-}
toS x = x;
a = addA "" ; -- this works, because the token from addA isn't glued at runtime. `a` is a 0-argument function, it is *created* by addA.
b = checkB "b" ; -- this works, because the token from checkB isn't checked at runtime. `b` is a 0-argument function, it is *created* by checkB.
oper
addA : Str -> Str = \s -> s + "a" ;
checkB : Str -> Str = \s -> case s of {
"b" => "your string was b" ;
_ => "your string wasn't b" } ;
}
@inariksit

This comment has been minimized.

Copy link
Owner Author

inariksit commented Oct 17, 2018

Minimal example for explaining the GF error message "unsupported token gluing"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.