Commit e5008729 authored by John van Groningen's avatar John van Groningen

support error messages of more than one line

parent f5dd40b7
...@@ -38,17 +38,14 @@ where ...@@ -38,17 +38,14 @@ where
//--- Error window handling //--- Error window handling
isErr Error = True countnums [message:messages] (e,w,i)
isErr _ = False | IsErrorMsg message
isWrn Warning = True = countnums (dropWhile first_char_is_space messages) (inc e,w,i)
isWrn _ = False | IsWarningMsg message
isInf Info = True = countnums messages (e,inc w,i)
isInf _ = False = countnums messages (e,w,inc i)
countnums [] nums
countnums [] nums = nums = nums
countnums [Error:ts] (e,w,i) = countnums ts (inc e,w,i)
countnums [Warning:ts] (e,w,i) = countnums ts (e,inc w,i)
countnums [Info:ts] (e,w,i) = countnums ts (e,w,inc i)
checkWindowExistence id io checkWindowExistence id io
# (st,io) = getWindowsStack io # (st,io) = getWindowsStack io
...@@ -71,9 +68,8 @@ updateErrorWindowInteractive messages ps ...@@ -71,9 +68,8 @@ updateErrorWindowInteractive messages ps
True -> ps True -> ps
_ -> err_open errinfo ps _ -> err_open errinfo ps
#! ps = appendFilteredListBoxItems errinfo.infoId messages ps #! ps = appendFilteredListBoxItems errinfo.infoId messages ps
#! types = map TypeErrorMsg messages
#! (numerr,numwrn,numinf) #! (numerr,numwrn,numinf)
= countnums types (errinfo.err_count,errinfo.wrn_count,errinfo.inf_count) = countnums messages (errinfo.err_count,errinfo.wrn_count,errinfo.inf_count)
# err = (errinfo.err_countId,toString numerr) # err = (errinfo.err_countId,toString numerr)
# wrn = (errinfo.wrn_countId,toString numwrn) # wrn = (errinfo.wrn_countId,toString numwrn)
# inf = (errinfo.inf_countId,toString numinf) # inf = (errinfo.inf_countId,toString numinf)
...@@ -198,17 +194,30 @@ where ...@@ -198,17 +194,30 @@ where
# ps = setErrInfo {ei & inf = inf} ps # ps = setErrInfo {ei & inf = inf} ps
# ps = setFilter ei.infoId (makeFilter err wrn inf) ps # ps = setFilter ei.infoId (makeFilter err wrn inf) ps
= ((err,wrn,inf),ps) = ((err,wrn,inf),ps)
makeFilter err wrn inf str
# msg = TypeErrorMsg str makeFilter err wrn inf [str:strings]
| isErr msg && not err = False | IsErrorMsg str
| isWrn msg && not wrn = False | err
| isInf msg && not inf = False # (error_strings,strings) = span first_char_is_space strings
= True = [str:error_strings++makeFilter err wrn inf strings]
= makeFilter err wrn inf (dropWhile first_char_is_space strings)
| IsWarningMsg str
| wrn
= [str:makeFilter err wrn inf strings]
= makeFilter err wrn inf strings
| inf
= [str:makeFilter err wrn inf strings]
= makeFilter err wrn inf strings
makeFilter err wrn inf []
= []
err_resize ih oc ow nw err_resize ih oc ow nw
= {w = nw.w, h = nw.Size.h - ih} = {w = nw.w, h = nw.Size.h - ih}
inf_resize oc ow nw inf_resize oc ow nw
= {oc & w = nw.w} = {oc & w = nw.w}
first_char_is_space s = size s>0 && s.[0]==' '
ew_activate cId ps ew_activate cId ps
# ({mn_cut,mn_cpy,mn_pst,mn_clr,mg_edt,searchIds},ps=:{io}) # ({mn_cut,mn_cpy,mn_pst,mn_clr,mg_edt,searchIds},ps=:{io})
= getMenuIds ps = getMenuIds ps
...@@ -563,34 +572,37 @@ err_shut info ...@@ -563,34 +572,37 @@ err_shut info
} }
= prefs = prefs
// IsErrorMsg :: !String -> Bool
// Extract module name and line number from error message. IsErrorMsg msg = type
// where
msglen = size msg
:: MessageType = Error | Warning | Info type
| msglen > 5 && msg%(0,4) == "Error" = True
TypeErrorMsg :: !String -> MessageType | msglen > 12 && msg%(0,11) == "Syntax error" = True
TypeErrorMsg msg = type | msglen > 11 && msg%(0,10) == "Parse error" = True
| msglen > 11 && msg%(0,10) == "Check error" = True
| msglen > 11 && msg%(0,10) == "Check Error" = True
| msglen > 10 && msg%(0,9) == "Type error" = True
| msglen > 10 && msg%(0,9) == "Link error" = True
| msglen > 12 && msg%(0,11) == "Linker error" = True
| msglen > 16 && msg%(0,15) == "Uniqueness error" = True
| msglen > 16 && msg%(0,15) == "Undefined symbol" = True
| msglen > 17 && msg%(0,16) == "Overloading error" = True
= False
IsWarningMsg :: !String -> Bool
IsWarningMsg msg = type
where where
msglen = size msg msglen = size msg
type type
| msglen > 5 && msg%(0,4) == "Error" = Error | msglen > 7 && msg%(0,6) == "Warning" = True
| msglen > 12 && msg%(0,11) == "Syntax error" = Error | msglen > 12 && msg%(0,11) == "Type warning" = True
| msglen > 11 && msg%(0,10) == "Parse error" = Error | msglen > 13 && msg%(0,12) == "Parse warning" = True
| msglen > 11 && msg%(0,10) == "Check error" = Error | msglen > 12 && msg%(0,11) == "Link warning" = True
| msglen > 11 && msg%(0,10) == "Check Error" = Error | msglen > 14 && msg%(0,13) == "Linker warning" = True
| msglen > 10 && msg%(0,9) == "Type error" = Error = False
| msglen > 10 && msg%(0,9) == "Link error" = Error //
| msglen > 12 && msg%(0,11) == "Linker error" = Error // Extract module name and line number from error message.
| msglen > 16 && msg%(0,15) == "Uniqueness error" = Error //
| msglen > 16 && msg%(0,15) == "Undefined symbol" = Error
| msglen > 17 && msg%(0,16) == "Overloading error" = Error
| msglen > 7 && msg%(0,6) == "Warning" = Warning
| msglen > 12 && msg%(0,11) == "Type warning" = Warning
| msglen > 13 && msg%(0,12) == "Parse warning" = Warning
| msglen > 12 && msg%(0,11) == "Link warning" = Warning
| msglen > 14 && msg%(0,13) == "Linker warning" = Warning
= Info
ParseErrorMsg :: !String -> (!Modulename, !Int); ParseErrorMsg :: !String -> (!Modulename, !Int);
ParseErrorMsg msg ParseErrorMsg msg
......
...@@ -26,7 +26,7 @@ flbKeyboard :: ({#Char} -> .(*(PSt .a) -> *PSt .a)) -> .ControlAttribute *((Filt ...@@ -26,7 +26,7 @@ flbKeyboard :: ({#Char} -> .(*(PSt .a) -> *PSt .a)) -> .ControlAttribute *((Filt
:: FilteredListBoxState :: FilteredListBoxState
setFilter :: !FilteredListBoxId (String->Bool) !(PSt .l) -> PSt .l setFilter :: !FilteredListBoxId ([String]->[String]) !(PSt .l) -> PSt .l
getFilter :: !FilteredListBoxId !(PSt .l) -> (!String->Bool,PSt .l) getFilter :: !FilteredListBoxId !(PSt .l) -> (![String]->[String],PSt .l)
getFilteredListBoxSelection :: !FilteredListBoxId !(PSt .l) -> (!(!Bool,![(String,!Index)]),!PSt .l) getFilteredListBoxSelection :: !FilteredListBoxId !(PSt .l) -> (!(!Bool,![(String,!Index)]),!PSt .l)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment