Skip to content

Instantly share code, notes, and snippets.

@inariksit
Created June 2, 2020 14:54
Show Gist options
  • Save inariksit/78a1929c4e98c5cc9d6ea693f7d0127f to your computer and use it in GitHub Desktop.
Save inariksit/78a1929c4e98c5cc9d6ea693f7d0127f to your computer and use it in GitHub Desktop.
abstract Test = {
cat S ;
fun testS : S ;
}
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