Last active
January 4, 2019 12:51
-
-
Save inariksit/edde72f43d439571c79f8ef758443c11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract UnsupportedTokenGluing = { | |
flags startcat = S ; | |
cat | |
S ; A ; | |
fun | |
toS : A -> S ; | |
a,b : A ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" } ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimal example for explaining the GF error message "unsupported token gluing"