Commit 25a0c78a authored by John van Groningen's avatar John van Groningen

also search in hierarchical modules of which the name starts with a lower case character

parent 9d14fbca
...@@ -315,21 +315,48 @@ FindIdentifiersInInput imp cleanid imports sym=:{repr} input positions ...@@ -315,21 +315,48 @@ FindIdentifiersInInput imp cleanid imports sym=:{repr} input positions
where where
FindFrom :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, !IdentifierPositionList) | ScanInput a; FindFrom :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, !IdentifierPositionList) | ScanInput a;
FindFrom imports input positions FindFrom imports input positions
# (input,sym,linenr,charnr) = ScanInput input; # (input,sym,linenr,charnr) = scan_module_symbol_from_input input;
| IdentSymId sym.repr | IdentSymId sym.repr
| sym.string == cleanid | sym.string == cleanid
# (input,sym,imports,positions) = FindFromIdent (sym.string :! imports) input positions # (input,sym,imports,positions) = FindFromIdent (sym.string :! imports) input positions
= (input,sym,imports,Pos linenr charnr positions) = (input,sym,imports,Pos linenr charnr positions)
= FindFromIdent (sym.string :! imports) input positions = FindFromIdent (sym.string :! imports) input positions
= (input,sym, imports,positions); = (input,sym, imports,positions);
where
FindFromIdent :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, IdentifierPositionList) | ScanInput a; FindFromIdent :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, IdentifierPositionList) | ScanInput a;
FindFromIdent imports input positions FindFromIdent imports input positions
# (input,sym,_,_) = ScanInput input; # (input,sym,_,_) = ScanInput input;
| sym.repr == ImportSymID | sym.repr == ImportSymID
# (input,sym,_,positions) = FindImport Nil input positions # (input,sym,positions) = FindImport input positions
= (input,sym,imports,positions) = (input,sym,imports,positions)
= (input, sym, imports,positions); = (input, sym, imports,positions);
FindImport :: !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !IdentifierPositionList) | ScanInput a;
FindImport input positions
# (input,sym,linenr,charnr) = ScanInput input
| IdentSymId sym.repr
| sym.string == cleanid
# (input,sym,positions) = FindImportIdent input positions
= (input,sym,Pos linenr charnr positions)
= FindImportIdent input positions
= (input,sym,positions);
where
FindImportIdent :: !(Input a) IdentifierPositionList -> (!Input a, !Symbol,IdentifierPositionList) | ScanInput a;
FindImportIdent input positions
# (input,sym,_,_) = ScanInput input
| sym.repr == CommaSymID
= FindImportIdentComma input positions
= (input,sym, positions);
FindImportIdentComma :: !(Input a) IdentifierPositionList -> (!Input a, !Symbol, IdentifierPositionList) | ScanInput a;
FindImportIdentComma input positions
# (input,sym,linenr,charnr) = ScanInput input
| IdentSymId sym.repr
| sym.string == cleanid
# (input,sym,positions) = FindImportIdent input positions
= (input,sym,Pos linenr charnr positions)
= FindImportIdent input positions
= (input,sym, positions)
FindImport :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, !IdentifierPositionList) | ScanInput a; FindImport :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String, !IdentifierPositionList) | ScanInput a;
FindImport imports input positions FindImport imports input positions
...@@ -340,23 +367,23 @@ where ...@@ -340,23 +367,23 @@ where
= (input,sym,imports,Pos linenr charnr positions) = (input,sym,imports,Pos linenr charnr positions)
= FindImportIdent (sym.string :! imports) input positions = FindImportIdent (sym.string :! imports) input positions
= (input,sym,imports,positions); = (input,sym,imports,positions);
where
FindImportIdent :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String,IdentifierPositionList) | ScanInput a; FindImportIdent :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String,IdentifierPositionList) | ScanInput a;
FindImportIdent imports input positions FindImportIdent imports input positions
# (input,sym,_,_) = ScanInput input # (input,sym,_,_) = ScanInput input
| sym.repr == CommaSymID | sym.repr == CommaSymID
= FindImportIdentComma imports input positions = FindImportIdentComma imports input positions
= (input,sym, imports,positions); = (input,sym, imports,positions);
FindImportIdentComma :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String,IdentifierPositionList) | ScanInput a; FindImportIdentComma :: !(List String) !(Input a) IdentifierPositionList -> (!Input a, !Symbol, !List String,IdentifierPositionList) | ScanInput a;
FindImportIdentComma imports input positions FindImportIdentComma imports input positions
# (input,sym,linenr,charnr) = scan_module_symbol_from_input input # (input,sym,linenr,charnr) = scan_module_symbol_from_input input
| IdentSymId sym.repr | IdentSymId sym.repr
| sym.string == cleanid | sym.string == cleanid
# (input,sym,imports,positions) = FindImportIdent (sym.string :! imports) input positions # (input,sym,imports,positions) = FindImportIdent (sym.string :! imports) input positions
= (input,sym,imports,Pos linenr charnr positions) = (input,sym,imports,Pos linenr charnr positions)
= FindImportIdent (sym.string :! imports) input positions = FindImportIdent (sym.string :! imports) input positions
= (input,sym, imports, positions) = (input,sym, imports, positions)
FindDefinitionInInput :: !Bool !String !(List String) !(Input a) -> (!Input a, !List String,!IdentifierPositionList) | ScanInput a; FindDefinitionInInput :: !Bool !String !(List String) !(Input a) -> (!Input a, !List String,!IdentifierPositionList) | ScanInput a;
FindDefinitionInInput imp cleanid imports input FindDefinitionInInput imp cleanid imports input
...@@ -792,7 +819,7 @@ find_module_symbol :: !Int !Int !String -> (!Bool,!Int,!Symbol); ...@@ -792,7 +819,7 @@ find_module_symbol :: !Int !Int !String -> (!Bool,!Int,!Symbol);
find_module_symbol curpos curlen line find_module_symbol curpos curlen line
| curpos >= curlen | curpos >= curlen
= (False, curpos, ErrorSym); = (False, curpos, ErrorSym);
| UpperCase line.[curpos] | UpperCase line.[curpos] || LowerCase line.[curpos]
= find_module_ident curpos (curpos+1) curlen line; = find_module_ident curpos (curpos+1) curlen line;
= FindSym curpos curlen line; = FindSym curpos curlen line;
where where
......
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