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
//--- Error window handling
isErr Error = True
isErr _ = False
isWrn Warning = True
isWrn _ = False
isInf Info = True
isInf _ = False
countnums [] 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)
countnums [message:messages] (e,w,i)
| IsErrorMsg message
= countnums (dropWhile first_char_is_space messages) (inc e,w,i)
| IsWarningMsg message
= countnums messages (e,inc w,i)
= countnums messages (e,w,inc i)
countnums [] nums
= nums
checkWindowExistence id io
# (st,io) = getWindowsStack io
......@@ -71,9 +68,8 @@ updateErrorWindowInteractive messages ps
True -> ps
_ -> err_open errinfo ps
#! ps = appendFilteredListBoxItems errinfo.infoId messages ps
#! types = map TypeErrorMsg messages
#! (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)
# wrn = (errinfo.wrn_countId,toString numwrn)
# inf = (errinfo.inf_countId,toString numinf)
......@@ -198,17 +194,30 @@ where
# ps = setErrInfo {ei & inf = inf} ps
# ps = setFilter ei.infoId (makeFilter err wrn inf) ps
= ((err,wrn,inf),ps)
makeFilter err wrn inf str
# msg = TypeErrorMsg str
| isErr msg && not err = False
| isWrn msg && not wrn = False
| isInf msg && not inf = False
= True
makeFilter err wrn inf [str:strings]
| IsErrorMsg str
| err
# (error_strings,strings) = span first_char_is_space strings
= [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
= {w = nw.w, h = nw.Size.h - ih}
inf_resize oc ow nw
= {oc & w = nw.w}
first_char_is_space s = size s>0 && s.[0]==' '
ew_activate cId ps
# ({mn_cut,mn_cpy,mn_pst,mn_clr,mg_edt,searchIds},ps=:{io})
= getMenuIds ps
......@@ -563,34 +572,37 @@ err_shut info
}
= prefs
//
// Extract module name and line number from error message.
//
:: MessageType = Error | Warning | Info
TypeErrorMsg :: !String -> MessageType
TypeErrorMsg msg = type
IsErrorMsg :: !String -> Bool
IsErrorMsg msg = type
where
msglen = size msg
type
| msglen > 5 && msg%(0,4) == "Error" = True
| msglen > 12 && msg%(0,11) == "Syntax error" = True
| 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
msglen = size msg
type
| msglen > 5 && msg%(0,4) == "Error" = Error
| msglen > 12 && msg%(0,11) == "Syntax error" = Error
| msglen > 11 && msg%(0,10) == "Parse error" = Error
| msglen > 11 && msg%(0,10) == "Check error" = Error
| msglen > 11 && msg%(0,10) == "Check Error" = Error
| msglen > 10 && msg%(0,9) == "Type error" = Error
| msglen > 10 && msg%(0,9) == "Link error" = Error
| msglen > 12 && msg%(0,11) == "Linker error" = Error
| 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
| msglen > 7 && msg%(0,6) == "Warning" = True
| msglen > 12 && msg%(0,11) == "Type warning" = True
| msglen > 13 && msg%(0,12) == "Parse warning" = True
| msglen > 12 && msg%(0,11) == "Link warning" = True
| msglen > 14 && msg%(0,13) == "Linker warning" = True
= False
//
// Extract module name and line number from error message.
//
ParseErrorMsg :: !String -> (!Modulename, !Int);
ParseErrorMsg msg
......
......@@ -26,7 +26,7 @@ flbKeyboard :: ({#Char} -> .(*(PSt .a) -> *PSt .a)) -> .ControlAttribute *((Filt
:: FilteredListBoxState
setFilter :: !FilteredListBoxId (String->Bool) !(PSt .l) -> PSt .l
getFilter :: !FilteredListBoxId !(PSt .l) -> (!String->Bool,PSt .l)
setFilter :: !FilteredListBoxId ([String]->[String]) !(PSt .l) -> PSt .l
getFilter :: !FilteredListBoxId !(PSt .l) -> (![String]->[String],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