Commit 13efbf36 authored by John van Groningen's avatar John van Groningen

add searching of generic definitions,

fix line comments and strings inside nested comments
parent 3f65e074
......@@ -1059,6 +1059,13 @@ where
= cl1 < cl2
sort (DefInst _ _ _) _ = True
sort _ (DefInst _ _ _) = False
sort (DefGeneric id1 _) (DefGeneric id2 _) = id1 < id2
sort (DefGeneric _ _) _ = True
sort _ (DefGeneric _ _) = False
sort (DefDerive cl1 id1 _)(DefDerive cl2 id2 _) | cl1 == cl2 = id1 < id2
= cl1 < cl2
sort (DefDerive _ _ _) _ = True
sort _ (DefDerive _ _ _) = False
sort (DefFun id1 _) (DefFun id2 _) = id1 < id2
sort (DefFun _ _) _ = True
sort _ (DefFun _ _) = False
......@@ -1068,6 +1075,8 @@ toMenuItem (DefFun id ln) = MenuItem (id) [MenuFunction (menfun ln)]
toMenuItem (DefType id ln) = MenuItem (":: "+++.id) [MenuFunction (menfun ln)]
toMenuItem (DefClass id ln) = MenuItem ("class "+++.id) [MenuFunction (menfun ln)]
toMenuItem (DefInst cl id ln) = MenuItem ("instance "+++.cl+++." "+++.id) [MenuFunction (menfun ln)]
toMenuItem (DefGeneric id ln) = MenuItem ("generic "+++.id) [MenuFunction (menfun ln)]
toMenuItem (DefDerive cl id ln) = MenuItem ("derive "+++.cl+++." "+++.id) [MenuFunction (menfun ln)]
menfun ln (ls,ps)
# (_,ps) = sendToActiveWindow (msgScrollToLine ln) ps
......@@ -1082,16 +1091,14 @@ purge_and_reverse acc []
= acc
purge_and_reverse [] [h:t]
= purge_and_reverse [h] t
purge_and_reverse [a:as] [d:ds]
| same a d
= purge_and_reverse [d:as] ds
purge_and_reverse [a=:(DefFun an al):as] [d=:(DefFun dn dl):ds]
| an==dn
| al<dl
= purge_and_reverse [a:as] ds
= purge_and_reverse [d:as] ds
= purge_and_reverse [d,a:as] ds
same (DefFun l _) (DefFun l` _) = l == l`
//same (DefType l _) (DefType l` _) = l == l`
//same (DefClass l _) (DefClass l` _) = l == l`
//same (DefInst l m _) (DefInst l` m` _) = l == l` && m == m`
same _ _ = False
purge_and_reverse [a:as] [d:ds]
= purge_and_reverse [d,a:as] ds
//==== 13/20 transition hack...
// Wrap...
......
......@@ -62,10 +62,12 @@ IsTypeSpec :: !String -> Bool;
IsImportError13 :: !String -> (!Bool,!String);
IsImportError20 :: !String -> (!Bool,!String);
// x-perimental...
:: Def
= DefFun String Int
| DefType String Int
| DefClass String Int
| DefInst String String Int
= DefFun !String !Int
| DefType !String !Int
| DefClass !String !Int
| DefInst !String !String !Int
| DefGeneric !String !Int
| DefDerive !String !String !Int
FindDefinesInText :: !*{String} !Files -> (![Def],!Files)
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