Skip to content

Instantly share code, notes, and snippets.

@inariksit
Last active January 4, 2019 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inariksit/edde72f43d439571c79f8ef758443c11 to your computer and use it in GitHub Desktop.
Save inariksit/edde72f43d439571c79f8ef758443c11 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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