Created
June 2, 2020 14:54
-
-
Save inariksit/78a1929c4e98c5cc9d6ea693f7d0127f 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 Test = { | |
cat S ; | |
fun testS : S ; | |
} |
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 TestCnc of Test = open Prelude in { | |
lincat S = SS ; | |
lin testS = mkSS "test" ; | |
oper | |
mkSS : Str -> SS ; | |
{- - compiling TestCnc.gf... gf: 11-13: In mkSS: unsupported token gluing: str + "bar" | |
-} | |
mkSS str = case str of { | |
x + "foo" => ss (x + "bar") | |
} ; | |
{- -- This version succeeds: | |
mkSS str = case str of { | |
x + "foo" => ss (x + "bar") | |
; x => ss (x + "baz") | |
} ; | |
-} | |
-- The two versions below give the expected error: | |
-- gf: Internal error in GeneratePMCFG: evalTerm ("test") | |
{- -- 1) | |
mkSS str = case str of { | |
x + "foo" => ss (str + "bar") | |
} ; | |
-} | |
{- -- 2) | |
mkSS str = case str of { | |
x + "foo" => ss x | |
} ; | |
-} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment