diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2020-06-16 09:50:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-16 09:50:05 +0200 |
| commit | aa9b4d06ba343e9b0dd9cd2269e42c76f6cd0b4e (patch) | |
| tree | 3cc0754956d94907f44cbf81444fdd5612acc594 /src/compiler/GF/Compile/GeneratePMCFG.hs | |
| parent | fff19f31af79956da08deb0eedd85dde63620f9f (diff) | |
| parent | de8cc02ba58d11957defdc89b6755eeb0b548fde (diff) | |
Merge pull request #55 from inariksit/error-messages
Improvements in common error messages
Diffstat (limited to 'src/compiler/GF/Compile/GeneratePMCFG.hs')
| -rw-r--r-- | src/compiler/GF/Compile/GeneratePMCFG.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index f0c256775..0558715c6 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -614,6 +614,20 @@ mkArray lst = listArray (0,length lst-1) lst mkSetArray map = array (0,Map.size map-1) [(v,k) | (k,v) <- Map.toList map] bug msg = ppbug msg -ppbug msg = error . render $ hang "Internal error in GeneratePMCFG:" 4 msg +ppbug msg = error completeMsg + where + originalMsg = render $ hang "Internal error in GeneratePMCFG:" 4 msg + completeMsg = + unlines [originalMsg + ,"" + ,"1) Check that you are not trying to pattern match a /runtime string/." + ," These are illegal:" + ," lin Test foo = case foo.s of {" + ," \"str\" => … } ; <- explicit matching argument of a lin" + ," lin Test foo = opThatMatches foo <- calling an oper that pattern matches" + ,"" + ,"2) Not about pattern matching? Submit a bug report and we update the error message." + ," https://github.com/GrammaticalFramework/gf-core/issues" + ] ppU = ppTerm Unqualified |
