Skip to content

Commit

Permalink
Fixed type parameters in regular symbols
Browse files Browse the repository at this point in the history
Fixes #1842
  • Loading branch information
PaulKlint committed Mar 17, 2024
1 parent 8099186 commit 644f51b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,9 @@ void collect(current:(Sym) `<Nonterminal n>`, Collector c){
}

void collect(current:(Sym) `& <Nonterminal n>`, Collector c){
c.use(n, {typeVarId()});
c.fact(current, n);
//c.use(n, {typeVarId()});
//c.fact(current, n);
c.fact(current, aparameter(prettyPrintName("<n>"),avalue()));
}

void collect(current:(Sym) `<Nonterminal n>[ <{Sym ","}+ parameters> ]`, Collector c){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ list[Message] compile(str qualifiedModuleName, RascalCompilerConfig compilerConf
start_comp = cpuTime();
ms = rascalTModelForNames([qualifiedModuleName], compilerConfig, compile1);

//iprintln(convertTModel2PhysicalLocs(ms.tmodels[qualifiedModuleName]), lineLimit=10000);
iprintln(convertTModel2PhysicalLocs(ms.tmodels[qualifiedModuleName]), lineLimit=10000);

comp_time = (cpuTime() - start_comp)/1000000;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
module lang::rascalcore::compile::Examples::Tst5


value main(){
if (int j := 1 || int j := 2) {
return j;
}
return -1;
import String;
void main(){
previous = "non empty";
msg = "<for (x <- ["a", "b", "c"]) { if (trim(previous) == "", trim(x) == "") { continue; } previous = x;><x>
'<}>";
}

//MH
//public void showUsageCounts(Corpus corpus, lrel[str p, str v, QueryResult qr] res) {
// mr = ( p : size([ e | <p,_,e> <- res ]) | p <- corpus );
// for (p <- sort([p | str p <- mr<0>])) println("<p>:<mr[p]>");
//}

//&T avoidEmpty(list[&T] l) { return 1; }
//&T avoidEmpty(list[&T] _) { throw "this should happen"; }
//
//test bool voidReturnIsNotAllowed() {
// try {
// avoidEmpty([]);
// return false;
// } catch "this should happen":
// return true;
//value main(){
// if (int j := 1 || int j := 2) {
// return j;
// }
// return -1;
//}


//data Wrapper[&SAME] = something(&SAME wrapped);
//
//@synopsis{it matters for testing that '&SAME' is the same name as in the definition of Wrapper}
Expand Down

0 comments on commit 644f51b

Please sign in to comment.