summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorInari Listenmaa <inari.listenmaa@gmail.com>2021-02-06 14:04:45 +0100
committerGitHub <noreply@github.com>2021-02-06 14:04:45 +0100
commit173fca7f125e84736e3d1cfe5b1b2e0b8d729141 (patch)
treeb514f2bae52223e4b628e3d6a00aea34209d330a /src
parent655173932ec529412b2a3f2b369e35aef6a39a8d (diff)
parentc6ff3e0c5ebd9bfcda05dd1199478837f09fb7e7 (diff)
Merge pull request #93 from inariksit/notYet-errormsg
Fix #92 (inappropriate error message)
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Compile/GeneratePMCFG.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs
index 35c25cc0d..ab6476b31 100644
--- a/src/compiler/GF/Compile/GeneratePMCFG.hs
+++ b/src/compiler/GF/Compile/GeneratePMCFG.hs
@@ -622,7 +622,9 @@ ppbug msg = error completeMsg
where
originalMsg = render $ hang "Internal error in GeneratePMCFG:" 4 msg
completeMsg =
- unlines [originalMsg
+ case render msg of -- the error message for pattern matching a runtime string
+ "descend (CStr 0,CNil,CProj (LIdent (Id {rawId2utf8 = \"s\"})) CNil)"
+ -> unlines [originalMsg -- add more helpful output
,""
,"1) Check that you are not trying to pattern match a /runtime string/."
," These are illegal:"
@@ -633,5 +635,6 @@ ppbug msg = error completeMsg
,"2) Not about pattern matching? Submit a bug report and we update the error message."
," https://github.com/GrammaticalFramework/gf-core/issues"
]
+ _ -> originalMsg -- any other message: just print it as is
ppU = ppTerm Unqualified